An opensource project from Internet Archive & tracey.
(work in progress)
- Setup VSCode (or similar) to run a command on every file save.
- Install
CodeRunr
extension: - This will sync your saved file to your CodeRunr Server
- It will auto-detect your checked out branch, git clone url, and do various setup, so that you'll get a unique https:// url (with automatic https certs) for each branch.
- Install
- Configure VSCode Settings:
- Change
example.com
to yourssh
-able CodeRunr Server (see below).
- Change
// Change `example.com` to your `ssh`-able CodeRunr Server.
"CodeRunr.server": "example.com",
"CodeRunr.match": "dev/|petabox",
- An admin needs to do a one-time setup of a DNS wildcard to point to a Virtual Machine that you can
ssh
into.- This will be your CodeRunr Server.
- The CodeRunr Server needs to have
docker
andgit
packages installed.
- The admin runs our container below, but:
- changes
code.archive.org
to whatever your DNS wildcard domain is. - changes
registry.archive.org
to whatever default docker container registry to use, if needed (repos using github.com/gitlab.com will get autodetected). This is optional -- you can set it to blank""
empty string.
- changes
docker run -d --net=host --privileged -v /var/run/docker.sock:/var/run/docker.sock --pull=always \
-e DOMAIN_WILDCARD=code.archive.org \
-e REGISTRY_FALLBACK=registry.archive.org \
-v /coderunr:/coderunr --restart=always --name coderunr -d ghcr.io/internetarchive/coderunr:main
- One docker container per repo, for trigger-based build & incremental build steps
- Option for repo to self-multiplex hostnames => docroots (eg: petabox)
- this allows for a full custom nginx and/or php webserver stack, etc.
- Off to a promising start -- basic concept working for static file server with build step and triggered re-build steps
- harder case php fastcgi dual LB/caddy layer idea manual testing seems workable
- user needs to
docker login
(on server running the[coderunr]
docker image) to any registry they can normallydocker pull
private images from - if your docker containers are having trouble talking to outside work, check
/etc/default/docker
and try something likeDOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4"
(google public DNS) in case that helps
- As of now, the CodeRunr Server needs
yq
. You can get like this (check https://github.com/mikefarah/yq/releases/latest for alternate OS/ARC if not linux amd64):
sudo wget -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.30.8/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- petabox repo needs 8010 UDP ferm port opened.
- xxx note: httpd.js no dir listings, but does serve DOTFILES
- xxx "clone" self locally first so repo YML overrides in our dir get used
- xxx make admin script(s) to restart all projects (remove dir, docker stop & rm -v ..) & coderunr
- xxx offshoot triggers
- xxx document repo docroot multiplexing setups
- xxx offshoot multistage build w/ rendertron makes nav...
- xxx document repo-based YAML overrides
- xxx webhooks
- GL per group
- GH per organization
# xxx `nom-ssh` variant that `cd` you to proper branch, once inside container, eg:
nomad alloc exec -i -t -task www-av a208c683 zsh -c 'cd /coderunr/main; zsh'
# nom-ssh (use group-project + branch)
ssh -t -A code 'docker exec -it ia-petabox bash -c "cd /coderunr/master; bash"'
# nom-logs (use group-project)
ssh -t -A code docker logs -f ia-petabox