Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hocus-dev/hocus
🪄 Spin up ready-to-code, disposable dev environments on your own servers. Self-hosted alternative to Gitpod and Github Codespaces.
https://github.com/hocus-dev/hocus
Last synced: about 1 month ago
JSON representation
🪄 Spin up ready-to-code, disposable dev environments on your own servers. Self-hosted alternative to Gitpod and Github Codespaces.
- Host: GitHub
- URL: https://github.com/hocus-dev/hocus
- Owner: hocus-dev
- License: other
- Created: 2022-07-15T19:06:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-08-09T14:08:38.000Z (about 1 year ago)
- Last Synced: 2024-09-25T23:50:50.854Z (about 1 month ago)
- Language: TypeScript
- Homepage: https://hocus.dev
- Size: 5.04 MB
- Stars: 3,231
- Watchers: 20
- Forks: 81
- Open Issues: 21
-
Metadata Files:
- Readme: README.dev.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome - hocus-dev/hocus - 🪄 Spin up ready-to-code, disposable dev environments on your own servers. Self-hosted alternative to Gitpod and Github Codespaces. (TypeScript)
README
# Developer README
Developer README. Not intended for end users.
## Running workflow tests
Inside a hocus workspace run:
```bash
sudo ./ops/bin/dev/run-agent-tests.sh
```You can set the following environment variable before running jest to see performance tracing:
```bash
PERF_MONITORING_ENABLED=1
```This builds test virtual machines, attaches to the running Hocus agent, and starts an E2E test suite using https://github.com/hocus-dev/tests
You may also attach to the agent container manually. The following runs a single E2E test of the prebuild workflow:
```bash
OCI_PROXY=host.docker.internal:9999 yarn jest 'app/agent/workflows.test.ts' -t 'runBuildfsAndPrebuilds' --testTimeout 600000
```## Add another BuildKite runner
```bash
cp resources/buildkite/buildkite-agent.cfg.example resources/buildkite/buildkite-agent.cfg
cp resources/buildkite/hooks/secrets.rc.example resources/buildkite/hooks/secrets.rc
# Change what you need in buildkite-agent.cfg
vim resources/buildkite/buildkite-agent.cfg
# And in secrets.rc
vim resources/buildkite/hooks/secrets.rc
# This will build a new VM based on resources/docker/buildkite-agent.Dockerfile and start it in qemu.
# 16GB of host memory is passed to the VM as a balloon device with free page reporting enabled :)
# Half of the host cores are passed to the VM
sudo ./ops/bin/dev/run-buildkite.sh
```## Running Hocus locally with an init configuration
Init configuration is a YAML file that defines users, projects, and repositories that Hocus creates when it starts.
It gets continuously updated by the control plane as users create new entities. Here's how to enable it.First, create a directory for the init configuration:
```bash
INIT_CONFIG_DIR_PATH="$(pwd)/hocus-init"
mkdir -p "$INIT_CONFIG_DIR_PATH"
```Hocus will create a file called `config.yaml` in this directory.
Then start Hocus with the environment variable `INIT_CONFIG_DIR_PATH`. Make sure it is an absolute path.
```bash
INIT_CONFIG_DIR_PATH="$INIT_CONFIG_DIR_PATH" HOCUS_HOSTNAME="localhost" ops/bin/local-up.sh
```