Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
goreleaser:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v5
Expand All @@ -17,11 +20,17 @@ jobs:
uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Login to Docker
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run GoReleaser
Expand Down Expand Up @@ -114,6 +123,9 @@ jobs:
if: github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: goreleaser
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v5
- name: Set up Docker Buildx
Expand All @@ -126,11 +138,12 @@ jobs:
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Docker Login
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Buildx
run: |
./base-images/envd/build.sh
Expand All @@ -139,14 +152,15 @@ jobs:
# only trigger on main repo when tag starts with v
if: github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- build_func: build
tag_suffix: ""
- build_func: build_gpu_11_8
tag_suffix: "-cuda-11.8.0-cudnn-8"
needs: goreleaser
steps:
- uses: actions/checkout@v5
Expand All @@ -170,11 +184,12 @@ jobs:
run: |
mv dist/envd_linux_amd64_v1/envd /usr/local/bin/envd
chmod +x /usr/local/bin/envd
- name: Docker Login
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_TOKEN }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
run: ./base-images/remote-cache/build-and-push-remote-cache.sh
env:
Expand Down
14 changes: 4 additions & 10 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,13 @@ archives:
ids:
- envd
name_template: >-
{{ .Binary }}_{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
Comment on lines -50 to -54
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea why the OS name should be capitalized here.

Arch names should be aligned.

{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
- id: envd-sshd
formats: ["binary"]
ids:
- envd-sshd
name_template: >-
{{ .Binary }}_{{ .Version }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
checksum:
name_template: 'checksums.txt'
snapshot:
Expand All @@ -88,6 +80,7 @@ dockers_v2:
- id: "envd"
images:
- "tensorchord/envd-from-scratch"
- "ghcr.io/tensorchord/envd-from-scratch"
dockerfile: base-images/envd/envd.Dockerfile
ids: ["envd"]
tags:
Expand All @@ -98,6 +91,7 @@ dockers_v2:
- id: "envd-sshd"
images:
- "tensorchord/envd-sshd-from-scratch"
- "ghcr.io/tensorchord/envd-sshd-from-scratch"
dockerfile: base-images/envd-sshd/envd-sshd.Dockerfile
ids: ["envd-sshd"]
tags:
Expand Down
4 changes: 2 additions & 2 deletions base-images/envd/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ ROOT_DIR=`dirname $0`

GIT_TAG_VERSION=$(git describe --tags --abbrev=0)
ENVD_VERSION="${ENVD_VERSION:-$GIT_TAG_VERSION}"
DOCKER_HUB_ORG="${DOCKER_HUB_ORG:-tensorchord}"
DOCKER_HUB_ORG="${DOCKER_HUB_ORG:-ghcr.io/tensorchord}"
TAG_SUFFIX="${TAG_SUFFIX:-}"

cd ${ROOT_DIR}

docker buildx build \
--build-arg ENVD_VERSION=${ENVD_VERSION} \
-t ${DOCKER_HUB_ORG}/envd:${ENVD_VERSION}-rootless \
--pull --push --platform linux/x86_64,linux/arm64 \
--pull --push --platform linux/amd64,linux/arm64 \
-f envd-daemonless.Dockerfile ../../

cd - > /dev/null
2 changes: 1 addition & 1 deletion base-images/envd/envd-daemonless.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG ENVD_VERSION

FROM tensorchord/envd-from-scratch:${ENVD_VERSION} as envd
FROM ghcr.io/tensorchord/envd-from-scratch:${ENVD_VERSION} as envd

FROM moby/buildkit:v0.25.1-rootless
COPY --from=envd /usr/bin/envd /usr/bin/envd
Expand Down
2 changes: 1 addition & 1 deletion base-images/remote-cache/build-and-push-remote-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ TAG_SUFFIX="${TAG_SUFFIX:-}"
cd ${ROOT_DIR}

envd context create --name docker --builder docker-container --use
envd --debug build -f build.envd:${BUILD_FUNC} --export-cache type=registry,ref=docker.io/${DOCKER_HUB_ORG}/python-cache:envd-v${ENVD_VERSION}${TAG_SUFFIX} --force
envd --debug build -f build.envd:${BUILD_FUNC} --export-cache type=registry,ref=ghcr.io/${DOCKER_HUB_ORG}/python-cache:envd-v${ENVD_VERSION}${TAG_SUFFIX} --force

cd - > /dev/null