{"id":13629671,"url":"https://github.com/seletskiy/hastur","last_synced_at":"2025-03-25T08:31:53.679Z","repository":{"id":44814166,"uuid":"43310879","full_name":"seletskiy/hastur","owner":"seletskiy","description":"Zero-configuration containers under systemd using systemd-nspawn","archived":false,"fork":false,"pushed_at":"2022-01-22T21:10:59.000Z","size":59,"stargazers_count":228,"open_issues_count":3,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-25T03:35:54.242Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seletskiy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-28T15:55:18.000Z","updated_at":"2024-11-18T15:55:21.000Z","dependencies_parsed_at":"2022-08-25T12:10:44.847Z","dependency_job_id":null,"html_url":"https://github.com/seletskiy/hastur","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fhastur","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fhastur/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fhastur/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seletskiy%2Fhastur/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seletskiy","download_url":"https://codeload.github.com/seletskiy/hastur/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245426445,"owners_count":20613359,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T22:01:16.205Z","updated_at":"2025-03-25T08:31:53.248Z","avatar_url":"https://github.com/seletskiy.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"![hastur](https://cloud.githubusercontent.com/assets/674812/10144792/fadcbd28-660e-11e5-8569-894e874cff14.png)\n\nhastur is a tool for launching systemd-nspawn containers without the need for\nmanual configuration.\n\nIt will setup networking, a base root FS and even an overlay FS for containers\nautomatically.\n\nThe primary usecase for hastur is supporting testcases for distributed systems\nand running a local set of trusted containers.\n\n![gif](https://cloud.githubusercontent.com/assets/674812/10140037/37f12ea2-65f5-11e5-90c7-eb18e6a9b37b.gif)\n\n# Motivation\n\nsystemd-nspawn is useful tool, which can create and run lightweight containers\nwithout any additional software, because it's available out-of-the-box systemd.\n\nHowever, it requires some configuration to run a working container, such as\nmanaging the network configuration, and downloading and extracting packages.\n\nhastur offers all this configuration automatically, which makes it possible to\nrun fully-configured systemd-nspawn containers in seconds.\n\n# Installation\n\n## Arch Linux\n\nhastur is available for Arch Linux (for now, only) through the AUR:\n\nhttps://aur4.archlinux.org/packages/hastur/\n\n## go get\n\nhastur is also go-gettable:\n\n```\ngo get github.com/seletskiy/hastur\n```\n\n# Usage\n\n## Testing water\n\nThe most simple usage is testing hastur out-of-the-box: you can tell it to\ncreate an ephemeral container with a basic set of packages:\n\n```\nsudo hastur -S\n```\n\nAfter invoking that command, you will end up ~~in Cthulhu's void~~ in the bash\nshell.\n\nThis test container will be deleted after you exit its shell.\n\n## Creating non-ephemeral containers\n\nPassing the `-k` flag will tell hastur to keep the container after exit:\n\n```\nsudo hastur -kS\n```\n\nIf you don't like the fantastical autogenerated names, you can pass the flag\n`-n`:\n\n```\nsudo hastur -Sn my-cool-name\n```\n\nNote that ephemeral containers are only the ones that both have autogenerated\nnames and were not started with the `-k` flag.\n\n## Networking\n\nhastur will take care of setting up the networking by creating a bridge and\nsetting up a shared network. By default, hastur will automatically generate IP\naddresses, and you can see a container's address either in its starting message\nor by running the query command:\n\n```\nsudo hastur -Q\n```\n\nYou can specify your own IP address by passing the `-a` flag, like this:\n\n```\nsudo hastur -S -a 10.0.0.2/8\n```\n\n## But what about software?\n\nhastur uses package-based container configurations and will happily populate\nyour container with the packages that you want. You can use the `-p` flag for\nthis:\n\n```\nsudo hastur -S -p nginx\n```\n\nThat will create a container with the `nginx` package pre-installed. In\nactuality, hastur uses overlays to keep base dirs separate from container data.\nThe base dirs, or, if you like, images, are just prepared root filesystems,\nwhich have pre-installed packages. You can query the cached base dirs by\nrunning hastur with the `-Qi` flag:\n\n```\nsudo hastur -Qi\n```\n\nIn fact, from hastur's standpoint, a container is just a data dir, which gets\noverlayed on top of a root filesystem and then given network capability, so\nit will not remember what IP address a container has or what set of packages it\nhas installed if you forget to specify the correct options.\n\nFor example:\n\n```\nsudo hastur -Sn test -p git -- /bin/git --version\n```\n\nWill output:\n\n```\ngit version 2.5.3\n```\n\nBut running this container the next time without `-p git` will tell you that\ngit is not installed:\n\n```\nsudo hastur -Sn test -- /bin/git --version\n```\n\nThis outputs:\n\n```\nNo such file or directory\n```\n\nHowever, this `test` container will have a separate FS and all data files will\npersist across the two runs.\n\n# Additional information\n\nhastur can operate over several root directories and keep container instances\nseparately from each other. The `-r` flag is used for this:\n\n```\nsudo hastur -r solar-system -Sn earth\nsudo hastur -r solar-system -Sn moon\nsudo hastur -r alpha-centauri -Sn a\nsudo hastur -r alpha-centauri -Sn b\nsudo hastur -r alpha-centauri -Sn c\n```\n\nThe output will be different for these two commands:\n\n```\nsudo hastur -r solar-system -Q\nsudo hastur -r alpha-centauri -Q\n```\n\nThe first one will list only the `earth` and `moon` containers, and the second\nwill only list the `a`, `b` and `c` containers.\n\n# License\n\nMIT.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseletskiy%2Fhastur","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseletskiy%2Fhastur","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseletskiy%2Fhastur/lists"}