From 191b97c3818f3b2c9089485ce1b181fc6139b182 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Fri, 10 Jan 2025 10:07:39 -0800 Subject: [PATCH] cache to/from gha? --- .github/workflows/_go-tests.yml | 13 +------------ Tiltfile | 18 ++++++------------ 2 files changed, 7 insertions(+), 24 deletions(-) diff --git a/.github/workflows/_go-tests.yml b/.github/workflows/_go-tests.yml index baf1b4412f7..73df9d66919 100644 --- a/.github/workflows/_go-tests.yml +++ b/.github/workflows/_go-tests.yml @@ -44,19 +44,8 @@ jobs: uses: ./.github/actions/go - name: Set up Depot CLI uses: depot/setup-action@v1 - - name: (temp) build rust image - run: | - docker login registry.depot.dev -u x-token -p $DEPOT_TOKEN - depot build --save --metadata-file build.json . - project_id=$(cat build.json | jq -r '."depot.build".projectID') - build_id=$(cat build.json | jq -r '."depot.build".buildID') - - echo "cached_image_ref=$project_id/$build_id" >> $GITHUB_ENV - env: - DEPOT_TOKEN: ${{ secrets.DEPOT_PROJECT_TOKEN }} + - uses: crazy-max/ghaction-github-runtime@v3 - uses: ./.github/actions/tilt - with: - cached-image-ref: ${{ env.cached_image_ref }} - run: bin/cluster-test.sh bash -c 'cd go && go test -timeout 30s -run ^TestNodeWatcher$ github.com/chroma-core/chroma/go/pkg/memberlist_manager' - name: Save service logs to artifact if: always() diff --git a/Tiltfile b/Tiltfile index 1924c54187e..5889749e666 100644 --- a/Tiltfile +++ b/Tiltfile @@ -46,22 +46,16 @@ docker_build( ignore=['**/*.pyc', 'chromadb/test/'], ) -docker_build( +custom_build( 'local:query-service', - '.', - only=["rust/", "idl/", "Cargo.toml", "Cargo.lock"], - dockerfile='./rust/worker/Dockerfile', - target='query_service', - cache_from=['type=registry,ref=registry.depot.dev/' + os.getenv('CACHED_IMAGE_REF')] + 'docker buildx build -t $EXPECTED_REF --target query_service --cache-from=type=gha --cache-to=type=gha --file rust/worker/Dockerfile .', + deps=['rust/worker/Dockerfile', 'rust/worker/Cargo.toml', 'rust/worker/Cargo.lock', 'rust/worker/src/'], ) -docker_build( +custom_build( 'local:compaction-service', - '.', - only=["rust/", "idl/", "Cargo.toml", "Cargo.lock"], - dockerfile='./rust/worker/Dockerfile', - target='compaction_service', - cache_from=['type=registry,ref=registry.depot.dev/' + os.getenv('CACHED_IMAGE_REF')] + 'docker buildx build -t $EXPECTED_REF --target compaction_service --cache-from=type=gha --cache-to=type=gha --file rust/worker/Dockerfile .', + deps=['rust/worker/Dockerfile', 'rust/worker/Cargo.toml', 'rust/worker/Cargo.lock', 'rust/worker/src/'], ) k8s_yaml(