diff --git a/.github/workflows/publish-kits.yaml b/.github/workflows/publish-kits.yaml index 628ecad..4cc07dd 100644 --- a/.github/workflows/publish-kits.yaml +++ b/.github/workflows/publish-kits.yaml @@ -3,9 +3,9 @@ name: publish-kits # Builds the kits and publishes them to this repository's container registry # (GHCR), as ghcr.io///: # -# labspace kit/ the Labspace runtime (a mixin for the `shell` agent) -# hello-lab examples/hello-lab/ a lab's content, as a kit -# building-images examples/building-images/ a lab's content, as a kit +# labspace kit/ the Labspace runtime (a mixin for the `shell` agent) +# hello-lab examples/hello-lab/ a lab's content, as a kit +# building-images-lab examples/building-images-lab/ a lab's content, as a kit # # What gets pushed, by event: # @@ -29,7 +29,7 @@ on: paths: - "kit/**" - "examples/hello-lab/**" - - "examples/building-images/**" + - "examples/building-images-lab/**" - ".github/workflows/publish-kits.yaml" push: tags: ["v*"] @@ -72,13 +72,13 @@ jobs: } labspace="$(read_version kit/labspace.yaml)" hello_lab="$(read_version examples/hello-lab/hello-lab.yaml)" - building_images="$(read_version examples/building-images/building-images.yaml)" + building_images_lab="$(read_version examples/building-images-lab/building-images-lab.yaml)" echo "labspace: ${labspace:-}" echo "hello-lab: ${hello_lab:-}" - echo "building-images: ${building_images:-}" + echo "building-images-lab: ${building_images_lab:-}" - if [ -z "$labspace" ] || [ "$labspace" != "$hello_lab" ] || [ "$labspace" != "$building_images" ]; then - echo "::error::The kits must share one version: kit/labspace.yaml says '${labspace}', examples/hello-lab/hello-lab.yaml says '${hello_lab}', examples/building-images/building-images.yaml says '${building_images}'." + if [ -z "$labspace" ] || [ "$labspace" != "$hello_lab" ] || [ "$labspace" != "$building_images_lab" ]; then + echo "::error::The kits must share one version: kit/labspace.yaml says '${labspace}', examples/hello-lab/hello-lab.yaml says '${hello_lab}', examples/building-images-lab/building-images-lab.yaml says '${building_images_lab}'." exit 1 fi @@ -109,9 +109,9 @@ jobs: - name: hello-lab context: examples/hello-lab descriptor: examples/hello-lab/hello-lab.yaml - - name: building-images - context: examples/building-images - descriptor: examples/building-images/building-images.yaml + - name: building-images-lab + context: examples/building-images-lab + descriptor: examples/building-images-lab/building-images-lab.yaml steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/README.md b/README.md index 64e2b50..495c41e 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ The published set is one ordinary mixin that pins both members by digest and car |---|---|---| | Labspace runtime | `ghcr.io/mathieu-benoit/labsbxes/labspace` | [kit/](kit) | | `hello-lab` content | `ghcr.io/mathieu-benoit/labsbxes/hello-lab` | [examples/hello-lab/](examples/hello-lab) | -| `building-images` content | `ghcr.io/mathieu-benoit/labsbxes/building-images` | [examples/building-images/](examples/building-images) | +| `building-images-lab` content | `ghcr.io/mathieu-benoit/labsbxes/building-images-lab` | [examples/building-images-lab/](examples/building-images-lab) | Run them from a **dedicated, empty folder**. `sbx run` mounts the current folder into the sandbox as its workspace, read-write. Started from your home directory, that would hand the sandbox your SSH keys, cloud and registry credentials, shell history and every other project, which defeats the point of a sandbox. Give it only what the lab needs: with a content kit the lab doesn't use the workspace at all, so an empty folder is enough. (`sbx` also blocks the home directory outright, with `mount "/Users/" overlaps Sandboxes configuration, state or credentials`.) @@ -147,10 +147,10 @@ sbx run shell --kit ghcr.io/mathieu-benoit/labsbxes/labspace:0.1.4 -p 8085:8085 sbx run shell --kit ghcr.io/mathieu-benoit/labsbxes/labspace:0.1.4 --kit ghcr.io/mathieu-benoit/labsbxes/hello-lab:0.1.4 -p 8085:8085 -p 3000:3000 --name hello-lab ``` -`building-images` (pin 5050 for its Quote App tab): +`building-images-lab` (pin 5050 for its Quote App tab): ```bash -sbx run shell --kit ghcr.io/mathieu-benoit/labsbxes/labspace:0.1.4 --kit ghcr.io/mathieu-benoit/labsbxes/building-images:0.1.4 -p 8085:8085 -p 5050:5050 --name building-images +sbx run shell --kit ghcr.io/mathieu-benoit/labsbxes/labspace:0.1.4 --kit ghcr.io/mathieu-benoit/labsbxes/building-images-lab:0.1.4 -p 8085:8085 -p 5050:5050 --name building-images-lab ``` Then open the host port `sbx ports ` lists for sandbox port 3030 (for example `sbx ports hello-lab`). @@ -163,7 +163,7 @@ Then open the host port `sbx ports ` lists for sandbox port 3030 (for exam Commits to `main` don't publish anything on their own. -The kits are versioned **in lockstep**. To release, bump `version:` to the same value in every descriptor (`kit/labspace.yaml`, `examples/hello-lab/hello-lab.yaml`, `examples/building-images/building-images.yaml`), merge, then push the matching tag (`git tag v0.2.0 && git push origin v0.2.0`). The workflow's first job fails the run if the versions differ, or if the tag doesn't name them (`v0.2.0` must mean `0.2.0`). The `v` is only on the git tag; the published image tags have none (`:0.2.0`), as the kit spec requires. +The kits are versioned **in lockstep**. To release, bump `version:` to the same value in every descriptor (`kit/labspace.yaml`, `examples/hello-lab/hello-lab.yaml`, `examples/building-images-lab/building-images-lab.yaml`), merge, then push the matching tag (`git tag v0.2.0 && git push origin v0.2.0`). The workflow's first job fails the run if the versions differ, or if the tag doesn't name them (`v0.2.0` must mean `0.2.0`). The `v` is only on the git tag; the published image tags have none (`:0.2.0`), as the kit spec requires. The workflow runs `kit-tck validate` (the specification's conformance checker, pinned and checksum-verified) every time: on pull requests against the built OCI layout, and after each publish against the artifact that actually reached the registry. The descriptors' `sourceUrl` becomes the `org.opencontainers.image.source` annotation, which is what links the packages to this repository. @@ -203,7 +203,7 @@ kit/ opt/labspace/bin/ # labspace-init.sh, labspace-stage.sh, labspace-ide.sh, labspace-ui.sh home/agent/.local/share/code-server/User/settings.json examples/hello-lab/ # a tiny lab: a content repo, and (hello-lab.yaml/.dockerfile) a content kit -examples/building-images/ # dockersamples/labspace-building-images as a content kit (Quote App on 5050) +examples/building-images-lab/ # dockersamples/labspace-building-images as a content kit (Quote App on 5050) ``` ### How a boot goes diff --git a/examples/building-images/.dockerignore b/examples/building-images-lab/.dockerignore similarity index 53% rename from examples/building-images/.dockerignore rename to examples/building-images-lab/.dockerignore index 7f95fe3..5831a29 100644 --- a/examples/building-images/.dockerignore +++ b/examples/building-images-lab/.dockerignore @@ -2,5 +2,5 @@ * !labspace !project -!building-images.yaml -!building-images.dockerfile +!building-images-lab.yaml +!building-images-lab.dockerfile diff --git a/examples/building-images/building-images.dockerfile b/examples/building-images-lab/building-images-lab.dockerfile similarity index 100% rename from examples/building-images/building-images.dockerfile rename to examples/building-images-lab/building-images-lab.dockerfile diff --git a/examples/building-images/building-images.yaml b/examples/building-images-lab/building-images-lab.yaml similarity index 100% rename from examples/building-images/building-images.yaml rename to examples/building-images-lab/building-images-lab.yaml diff --git a/examples/building-images/labspace/01-welcome.md b/examples/building-images-lab/labspace/01-welcome.md similarity index 100% rename from examples/building-images/labspace/01-welcome.md rename to examples/building-images-lab/labspace/01-welcome.md diff --git a/examples/building-images/labspace/02-image-layers.md b/examples/building-images-lab/labspace/02-image-layers.md similarity index 100% rename from examples/building-images/labspace/02-image-layers.md rename to examples/building-images-lab/labspace/02-image-layers.md diff --git a/examples/building-images/labspace/03-best-practices.md b/examples/building-images-lab/labspace/03-best-practices.md similarity index 100% rename from examples/building-images/labspace/03-best-practices.md rename to examples/building-images-lab/labspace/03-best-practices.md diff --git a/examples/building-images/labspace/04-multistage-builds.md b/examples/building-images-lab/labspace/04-multistage-builds.md similarity index 100% rename from examples/building-images/labspace/04-multistage-builds.md rename to examples/building-images-lab/labspace/04-multistage-builds.md diff --git a/examples/building-images/labspace/05-base-images.md b/examples/building-images-lab/labspace/05-base-images.md similarity index 100% rename from examples/building-images/labspace/05-base-images.md rename to examples/building-images-lab/labspace/05-base-images.md diff --git a/examples/building-images/labspace/06-build-secrets.md b/examples/building-images-lab/labspace/06-build-secrets.md similarity index 100% rename from examples/building-images/labspace/06-build-secrets.md rename to examples/building-images-lab/labspace/06-build-secrets.md diff --git a/examples/building-images/labspace/07-wrap-up.md b/examples/building-images-lab/labspace/07-wrap-up.md similarity index 100% rename from examples/building-images/labspace/07-wrap-up.md rename to examples/building-images-lab/labspace/07-wrap-up.md diff --git a/examples/building-images/labspace/labspace.yaml b/examples/building-images-lab/labspace/labspace.yaml similarity index 100% rename from examples/building-images/labspace/labspace.yaml rename to examples/building-images-lab/labspace/labspace.yaml diff --git a/examples/building-images/project/Dockerfile b/examples/building-images-lab/project/Dockerfile similarity index 100% rename from examples/building-images/project/Dockerfile rename to examples/building-images-lab/project/Dockerfile diff --git a/examples/building-images/project/README.md b/examples/building-images-lab/project/README.md similarity index 100% rename from examples/building-images/project/README.md rename to examples/building-images-lab/project/README.md diff --git a/examples/building-images/project/requirements-dev.txt b/examples/building-images-lab/project/requirements-dev.txt similarity index 100% rename from examples/building-images/project/requirements-dev.txt rename to examples/building-images-lab/project/requirements-dev.txt diff --git a/examples/building-images/project/requirements.txt b/examples/building-images-lab/project/requirements.txt similarity index 100% rename from examples/building-images/project/requirements.txt rename to examples/building-images-lab/project/requirements.txt diff --git a/examples/building-images/project/src/app.py b/examples/building-images-lab/project/src/app.py similarity index 100% rename from examples/building-images/project/src/app.py rename to examples/building-images-lab/project/src/app.py diff --git a/examples/building-images/project/tests/__init__.py b/examples/building-images-lab/project/tests/__init__.py similarity index 100% rename from examples/building-images/project/tests/__init__.py rename to examples/building-images-lab/project/tests/__init__.py diff --git a/examples/building-images/project/tests/test_app.py b/examples/building-images-lab/project/tests/test_app.py similarity index 100% rename from examples/building-images/project/tests/test_app.py rename to examples/building-images-lab/project/tests/test_app.py