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
14 changes: 8 additions & 6 deletions .github/workflows/app-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,21 @@ permissions:

jobs:
Update-App-Config:
runs-on: ubuntu-latest
runs-on: gha-runner-supervisely
outputs:
RELEASE_TYPE: ${{ steps.update_app_config.outputs.RELEASE_TYPE }}
COMMIT_HASH: ${{ steps.update_app_config.outputs.COMMIT_HASH }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}
ref: master

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: 3.8
python-version: "3.12"

- name: Update App Config
env:
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
Expand All @@ -54,7 +56,7 @@ jobs:
VERSION="${VERSION:1}"
fi
echo "DOCKER_IMAGE=$VERSION" >> $GITHUB_ENV

SEMVER_REGEX="^[0-9]+\.[0-9]+\.[0-9]+$"
if [[ ! $VERSION =~ $SEMVER_REGEX ]]; then
RELEASE_TYPE="release-branch"
Expand All @@ -63,7 +65,7 @@ jobs:
fi
echo "RELEASE_TYPE=$RELEASE_TYPE" >> $GITHUB_OUTPUT
echo "RELEASE_TYPE=$RELEASE_TYPE"

python app/update_config.py $VERSION

git add app/config.json
Expand Down
48 changes: 18 additions & 30 deletions .github/workflows/build-push-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,29 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: gha-runner-supervisely

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Write Tag to ENV variable
run: echo "BRANCH_NAME=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME_COMMUNITY }}
password: ${{ secrets.DOCKER_TOKEN_COMMUNITY }}

- name: Get Docker Labels from python script
run: python .github/workflows/docker_labels.py
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.9.1

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
provenance: false
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: |
supervisely/agent:dev
build-args: |
LABEL_VERSION=agent:6.999.0
LABEL_INFO=${{ env.LABEL_INFO }}
LABEL_MODES=${{ env.LABEL_MODES }}
LABEL_README=${{ env.LABEL_README }}
LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }}
cache-from: type=registry,ref=supervisely/agent:cache
cache-to: type=registry,ref=supervisely/agent:cache,mode=max
# cache-from: type=gha
# cache-to: type=gha,mode=max
run: |
buildctl build \
--frontend dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=image,name=supervisely/agent:dev,push=true \
--opt provenance=false \
--opt build-arg=LABEL_VERSION=6.999.0 \
--opt build-arg=LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg=LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg=LABEL_README=${{ env.LABEL_README }} \
--opt build-arg=LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--import-cache type=registry,ref=supervisely/agent:dev-cache \
--export-cache type=registry,ref=supervisely/agent:dev-cache,mode=max
68 changes: 20 additions & 48 deletions .github/workflows/build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,73 +6,46 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: gha-runner-supervisely

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Echo ${{ github.event.release.tag_name }}
run: echo ${{ github.event.release.tag_name }}

- name: Write version to ENV variable
run: |
TAG_NAME=${{ github.event.release.tag_name }}
echo "LABEL_VERSION=${TAG_NAME:1}" >> $GITHUB_ENV

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME_COMMUNITY }}
password: ${{ secrets.DOCKER_TOKEN_COMMUNITY }}
TAG_NAME=${{ github.event.release.tag_name }}
echo "LABEL_VERSION=${TAG_NAME:1}" >> $GITHUB_ENV

- name: Get Docker Labels from python script
run: python .github/workflows/docker_labels.py

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.9.1

- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
provenance: false
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: |
supervisely/agent:${{ env.LABEL_VERSION }}
build-args: |
LABEL_VERSION=agent:${{ env.LABEL_VERSION }}
LABEL_INFO=${{ env.LABEL_INFO }}
LABEL_MODES=${{ env.LABEL_MODES }}
LABEL_README=${{ env.LABEL_README }}
LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }}
cache-from: type=registry,ref=supervisely/agent:cache
cache-to: type=registry,ref=supervisely/agent:cache,mode=max
# cache-from: type=gha
# cache-to: type=gha,mode=max

run: |
buildctl build \
--frontend dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=image,name=supervisely/agent:${{ env.LABEL_VERSION }},push=true \
--opt provenance=false \
--opt build-arg=LABEL_VERSION=agent:${{ env.LABEL_VERSION }} \
--opt build-arg=LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg=LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg=LABEL_README=${{ env.LABEL_README }} \
--opt build-arg=LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--import-cache type=registry,ref=supervisely/agent:cache \
--export-cache type=registry,ref=supervisely/agent:cache,mode=max

app-release:
needs: build
permissions:
contents: write
actions: write
uses: supervisely/agent/.github/workflows/app-release.yml@app-release
secrets:
secrets:
SUPERVISELY_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_DEV_API_TOKEN }}"
SUPERVISELY_PRIVATE_DEV_API_TOKEN: "${{ secrets.SUPERVISELY_PRIVATE_DEV_API_TOKEN }}"
SUPERVISELY_PROD_API_TOKEN: "${{ secrets.SUPERVISELY_PROD_API_TOKEN }}"
Expand All @@ -82,4 +55,3 @@ jobs:
SUPERVISELY_PROD_SERVER_ADDRESS: "${{ vars.SUPERVISELY_PROD_SERVER_ADDRESS }}"
RELEASE_VERSION: "${{ github.event.release.tag_name }}"
RELEASE_DESCRIPTION: "${{ github.event.release.name }}"

60 changes: 20 additions & 40 deletions .github/workflows/manual-build-push-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,55 +14,36 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: gha-runner-supervisely

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Tag Version
run: echo ${{ github.event.inputs.tag_version }}

- name: Write Tag to ENV variable
run: echo "LABEL_VERSION=${{ github.event.inputs.tag_version }}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME_COMMUNITY }}
password: ${{ secrets.DOCKER_TOKEN_COMMUNITY }}

- name: Get Docker Labels from python script
run: python .github/workflows/docker_labels.py
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.9.1
- name: Build and push
uses: docker/build-push-action@v5
with:
context: ./
file: ./Dockerfile
provenance: false
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: |
supervisely/agent:${{ env.LABEL_VERSION }}

build-args: |
LABEL_VERSION=agent:${{ env.LABEL_VERSION }}
LABEL_INFO=${{ env.LABEL_INFO }}
LABEL_MODES=${{ env.LABEL_MODES }}
LABEL_README=${{ env.LABEL_README }}
LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }}
cache-from: type=registry,ref=supervisely/agent:cache
cache-to: type=registry,ref=supervisely/agent:cache,mode=max
- name: Build and push
run: |
buildctl build \
--frontend dockerfile.v0 \
--local context=. \
--local dockerfile=. \
--output type=image,name=supervisely/agent:${{ env.LABEL_VERSION }},push=true \
--opt provenance=false \
--opt build-arg=LABEL_VERSION=agent:${{ env.LABEL_VERSION }} \
--opt build-arg=LABEL_INFO=${{ env.LABEL_INFO }} \
--opt build-arg=LABEL_MODES=${{ env.LABEL_MODES }} \
--opt build-arg=LABEL_README=${{ env.LABEL_README }} \
--opt build-arg=LABEL_BUILT_AT=${{ env.LABEL_BUILT_AT }} \
--import-cache type=registry,ref=supervisely/agent:cache \
--export-cache type=registry,ref=supervisely/agent:cache,mode=max

app-release:
needs: build
Expand All @@ -80,4 +61,3 @@ jobs:
SUPERVISELY_PROD_SERVER_ADDRESS: "${{ vars.SUPERVISELY_PROD_SERVER_ADDRESS }}"
RELEASE_VERSION: "${{ inputs.tag_version }}"
RELEASE_DESCRIPTION: "${{ inputs.release_description }}"

Loading