Skip to content

Commit

Permalink
build: Update release workflow and Taskfile for improved cached conta…
Browse files Browse the repository at this point in the history
…iner build process

Signed-off-by: Eden Reich <[email protected]>
  • Loading branch information
edenreich committed Feb 26, 2025
1 parent 72a5c91 commit c78b91c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,5 +277,4 @@ jobs:
--cache=true \
--cache-repo=${{ env.CONTAINER_REGISTRY }}/${{ env.REPOSITORY_OWNER }}/${{ env.REPOSITORY_NAME }}/cache-${{ matrix.target }} \
--cache-ttl=336h \
--compressed-caching=true \
--snapshot-mode=redo
--compressed-caching=true
50 changes: 32 additions & 18 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ tasks:
build-container:
desc: Run the release container command locally
vars:
GITHUB_USER:
sh: echo edenreich
GITHUB_TOKEN:
sh: echo ${GITHUB_TOKEN}
ORG_NAME:
sh: echo inference-gateway
GITHUB_USER: edenreich
GITHUB_TOKEN: ${GITHUB_TOKEN}
REPOSITORY_OWNER: inference-gateway
REPOSITORY_NAME: coder
ORG_NAME: inference-gateway
TARGET: aarch64-unknown-linux-musl
VERSION: local
CONTAINER_REGISTRY: ghcr.io
cmds:
- mkdir -p $(pwd)/kaniko/cache
- mkdir -p $(pwd)/kaniko/.docker
Expand All @@ -63,16 +65,28 @@ tasks:
-v $(pwd)/kaniko/cache:/cache \
-v $(pwd)/kaniko/.docker:/kaniko/.docker \
-w /workspace \
--entrypoint="" \
gcr.io/kaniko-project/executor:v1.23.2-debug \
--context=. \
--dockerfile=Dockerfile \
--target=minimal \
--build-arg=TARGET_ARCH=aarch64-unknown-linux-musl \
--no-push \
--tar-path=/workspace/artifacts/my-image.tar \
--cache=true \
--cache-repo=ghcr.io/{{.ORG_NAME}}/coder-cache \
--cache-ttl=336h \
--compressed-caching=true \
--snapshot-mode=redo \
--use-new-run
/kaniko/executor \
--context=. \
--dockerfile=Dockerfile \
--target=minimal \
--destination={{.CONTAINER_REGISTRY}}/{{.REPOSITORY_OWNER}}/{{.REPOSITORY_NAME}}:latest \
--destination={{.CONTAINER_REGISTRY}}/{{.REPOSITORY_OWNER}}/{{.REPOSITORY_NAME}}:minimal \
--destination={{.CONTAINER_REGISTRY}}/{{.REPOSITORY_OWNER}}/{{.REPOSITORY_NAME}}:minimal-{{.VERSION}} \
--build-arg=TARGET_ARCH={{.TARGET}} \
--label="org.opencontainers.image.version={{.VERSION}}" \
--label="org.opencontainers.image.revision=" \
--label="org.opencontainers.image.source=" \
--label="org.opencontainers.image.url=" \
--label="org.opencontainers.image.documentation=" \
--label="org.opencontainers.image.title=Coder" \
--label="org.opencontainers.image.description=The AI-Powered Coder without tools" \
--label="org.opencontainers.image.licenses=MIT" \
--label="org.opencontainers.image.vendor=" \
--no-push \
--tar-path=/workspace/artifacts/my-image.tar \
--cache=true \
--cache-repo={{.CONTAINER_REGISTRY}}/{{.REPOSITORY_OWNER}}/{{.REPOSITORY_NAME}}/cache-{{.TARGET}}-local \
--cache-ttl=336h \
--compressed-caching=true

0 comments on commit c78b91c

Please sign in to comment.