Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: parameterise s3 build cache setup #465

Merged
merged 6 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions .github/workflows/hole-punch-interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/run-interop-hole-punch-test
with:
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
s3-access-key-id: ${{ vars.S3_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
worker-count: 16
6 changes: 3 additions & 3 deletions .github/workflows/transport-interop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
- uses: actions/checkout@v3
- uses: ./.github/actions/run-transport-interop-test
with:
s3-cache-bucket: libp2p-by-tf-aws-bootstrap
s3-access-key-id: ${{ vars.S3_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_AWS_SECRET_ACCESS_KEY }}
s3-cache-bucket: ${{ vars.S3_LIBP2P_BUILD_CACHE_BUCKET_NAME }}
s3-access-key-id: ${{ vars.S3_LIBP2P_BUILD_CACHE_AWS_ACCESS_KEY_ID }}
s3-secret-access-key: ${{ secrets.S3_LIBP2P_BUILD_CACHE_AWS_SECRET_ACCESS_KEY }}
worker-count: 16
build-without-secrets:
runs-on: ubuntu-latest
Expand Down
7 changes: 6 additions & 1 deletion hole-punch-interop/helpers/cache.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const AWS_BUCKET = process.env.AWS_BUCKET || 'libp2p-by-tf-aws-bootstrap';
const AWS_BUCKET = process.env.AWS_BUCKET;
const scriptDir = __dirname;

import * as crypto from 'crypto';
Expand Down Expand Up @@ -73,6 +73,11 @@ async function loadCacheOrBuild(dir: string, ig: Ignore) {
const cacheKey = await hashFiles(files)
console.log("Cache key:", cacheKey)

if (AWS_BUCKET === "") {
console.log("Cache not found", new Error("AWS_BUCKET not set"))
galargh marked this conversation as resolved.
Show resolved Hide resolved
return
}

if (mode == Mode.PushCache) {
console.log("Pushing cache")
try {
Expand Down
7 changes: 6 additions & 1 deletion transport-interop/helpers/cache.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const AWS_BUCKET = process.env.AWS_BUCKET || 'libp2p-by-tf-aws-bootstrap';
const AWS_BUCKET = process.env.AWS_BUCKET;
const scriptDir = __dirname;

import * as crypto from 'crypto';
Expand Down Expand Up @@ -62,6 +62,11 @@ switch (modeStr) {
const cacheKey = await hashFiles(files)
console.log("Cache key:", cacheKey)

if (AWS_BUCKET === "") {
console.log("Cache not found", new Error("AWS_BUCKET not set"))
galargh marked this conversation as resolved.
Show resolved Hide resolved
continue
}

if (mode == Mode.PushCache) {
console.log("Pushing cache")
try {
Expand Down
Loading