Skip to content

Commit

Permalink
Use Github actions cache in sandbox build (flyteorg#2594)
Browse files Browse the repository at this point in the history
* Use Github actions cache in sandbox build

Signed-off-by: Eduardo Apolinario <[email protected]>

* test - bump propeller to 1.1.11

Signed-off-by: Eduardo Apolinario <[email protected]>

* Revert "test - bump propeller to 1.1.11"

This reverts commit 8efe288.

Signed-off-by: Eduardo Apolinario <[email protected]>

* Bump propeller

Signed-off-by: Eduardo Apolinario <[email protected]>

* Revert "Bump propeller"

This reverts commit ce58e6c.

Signed-off-by: Eduardo Apolinario <[email protected]>

* Mount cache for go build

Signed-off-by: Eduardo Apolinario <[email protected]>

* Bump propeller

Signed-off-by: Eduardo Apolinario <[email protected]>

* Revert "Bump propeller"

This reverts commit ce58e6c.

Signed-off-by: Eduardo Apolinario <[email protected]>

Co-authored-by: Eduardo Apolinario <[email protected]>
  • Loading branch information
eapolinario and eapolinario authored Jun 22, 2022
1 parent e936aca commit 4b4acdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 33 deletions.
36 changes: 4 additions & 32 deletions .github/workflows/sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx
- name: Login to GitHub Container Registry
if: ${{ github.event_name == 'release' }}
uses: docker/login-action@v1
Expand All @@ -65,15 +58,8 @@ jobs:
tags: ${{ steps.dind-names.outputs.tags }}
build-args: "FLYTE_VERSION=${{ steps.set_version.outputs.flyte_version }}"
file: docker/sandbox/Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max
sandbox-lite-build-dind:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -104,13 +90,6 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-single-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-single-buildx
- name: Login to GitHub Container Registry
if: ${{ github.event_name == 'release' }}
uses: docker/login-action@v1
Expand All @@ -128,12 +107,5 @@ jobs:
tags: ${{ steps.dind-names.outputs.tags }}
build-args: "FLYTE_VERSION=${{ steps.set_version.outputs.flyte_version }}"
file: docker/sandbox-lite/Dockerfile
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new
- # Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
cache-from: type=gha
cache-to: type=gha,mode=max
5 changes: 4 additions & 1 deletion docker/sandbox-lite/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# syntax=docker/dockerfile:1.3


ARG FLYTE_VERSION="latest"
FROM ghcr.io/flyteorg/flyteconsole-release:${FLYTE_VERSION} AS flyteconsole

Expand All @@ -13,7 +16,7 @@ RUN go mod download
COPY --from=flyteconsole /app/dist /app/flyte/cmd/single/dist

COPY cmd/ /app/flyte/cmd/
RUN go build -tags console -v -o /flyte cmd/main.go
RUN --mount=type=cache,target=/root/.cache/go-build go build -tags console -v -o /flyte cmd/main.go

FROM alpine:3.15 AS base

Expand Down

0 comments on commit 4b4acdc

Please sign in to comment.