Skip to content

Commit

Permalink
cache to/from gha?
Browse files Browse the repository at this point in the history
  • Loading branch information
codetheweb committed Jan 14, 2025
1 parent 41c66b9 commit 191b97c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 24 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/_go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
18 changes: 6 additions & 12 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 191b97c

Please sign in to comment.