From c00dc57ad00ed262b16caa0601afa2de3032bc6e Mon Sep 17 00:00:00 2001 From: Rail Aliiev Date: Thu, 29 Dec 2022 21:31:15 +0000 Subject: [PATCH] ci: do not publish to S3 Previously, we published CI and release artifacts to both S3 and GCS. After switching the CDN from CloudFront to Google CDN, we can stop publishing to both locations. This PR removes S3 related code and references from various CI tools. Fixes: RE-342 Epic: none Release note: None --- .../post-merge/publish-bleeding-edge.sh | 6 +- .../release/publish/sign_macos_release.sh | 6 - .../make-and-publish-build-artifacts.sh | 11 +- .../process/publish-cockroach-release.sh | 28 ++- pkg/cmd/cloudupload/main.go | 23 --- pkg/cmd/publish-artifacts/main.go | 24 +-- pkg/cmd/publish-artifacts/main_test.go | 92 +++++----- pkg/cmd/publish-provisional-artifacts/main.go | 25 +-- .../main_test.go | 167 +++++++++--------- pkg/release/BUILD.bazel | 4 - pkg/release/gcs.go | 4 +- pkg/release/s3.go | 80 --------- scripts/verify-release-binaries.sh | 97 ---------- 13 files changed, 148 insertions(+), 419 deletions(-) delete mode 100644 pkg/release/s3.go delete mode 100755 scripts/verify-release-binaries.sh diff --git a/build/teamcity/cockroach/post-merge/publish-bleeding-edge.sh b/build/teamcity/cockroach/post-merge/publish-bleeding-edge.sh index 3467068474a1..2b6dc566180b 100755 --- a/build/teamcity/cockroach/post-merge/publish-bleeding-edge.sh +++ b/build/teamcity/cockroach/post-merge/publish-bleeding-edge.sh @@ -9,18 +9,16 @@ dir="$(dirname $(dirname $(dirname $(dirname "${0}"))))" source "$dir/teamcity-support.sh" source "$dir/teamcity-bazel-support.sh" -# s3 pushes to the "cockroach" bucket. There is no test/dev bucket fir this build type. -bucket="cockroach" gcs_bucket="cockroach-edge-artifacts-prod" # export the variable to avoid shell escaping export gcs_credentials="$GCS_CREDENTIALS_PROD" -BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e gcs_credentials -e bucket=$bucket -e gcs_bucket=$gcs_bucket" run_bazel << 'EOF' +BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH -e gcs_credentials -e gcs_bucket=$gcs_bucket" run_bazel << 'EOF' bazel build --config ci //pkg/cmd/publish-artifacts BAZEL_BIN=$(bazel info bazel-bin --config ci) export google_credentials="$gcs_credentials" source "build/teamcity-support.sh" # For log_into_gcloud log_into_gcloud export GOOGLE_APPLICATION_CREDENTIALS="$PWD/.google-credentials.json" -$BAZEL_BIN/pkg/cmd/publish-artifacts/publish-artifacts_/publish-artifacts --gcs-bucket="$gcs_bucket" --bucket="$bucket" +$BAZEL_BIN/pkg/cmd/publish-artifacts/publish-artifacts_/publish-artifacts --gcs-bucket="$gcs_bucket" EOF diff --git a/build/teamcity/internal/cockroach/release/publish/sign_macos_release.sh b/build/teamcity/internal/cockroach/release/publish/sign_macos_release.sh index 742f16e33f74..1283bf9695ff 100755 --- a/build/teamcity/internal/cockroach/release/publish/sign_macos_release.sh +++ b/build/teamcity/internal/cockroach/release/publish/sign_macos_release.sh @@ -14,14 +14,12 @@ trap remove_files_on_exit EXIT # By default, set dry-run variables google_credentials="$GCS_CREDENTIALS_DEV" -s3_bucket="cockroach-builds-test" gcs_bucket="cockroach-release-artifacts-dryrun" # override dev defaults with production values if [[ -z "${DRY_RUN}" ]] ; then echo "Setting production variable values" google_credentials="$GCS_CREDENTIALS_PROD" - s3_bucket="binaries.cockroachdb.com" gcs_bucket="cockroach-release-artifacts-prod" fi @@ -76,10 +74,6 @@ for product in cockroach cockroach-sql; do rm -rf "$base" "$unsigned_file" "$unsigned_file.sha256sum" crl.zip shasum --algorithm 256 "$target" > "$target.sha256sum" - "$BAZEL_BIN/pkg/cmd/cloudupload/cloudupload_/cloudupload" \ - "$target" "s3://$s3_bucket/$target" - "$BAZEL_BIN/pkg/cmd/cloudupload/cloudupload_/cloudupload" \ - "$target.sha256sum" "s3://$s3_bucket/$target.sha256sum" "$BAZEL_BIN/pkg/cmd/cloudupload/cloudupload_/cloudupload" \ "$target" "gs://$gcs_bucket/$target" "$BAZEL_BIN/pkg/cmd/cloudupload/cloudupload_/cloudupload" \ diff --git a/build/teamcity/internal/release/process/make-and-publish-build-artifacts.sh b/build/teamcity/internal/release/process/make-and-publish-build-artifacts.sh index 027b5e26815e..75607e186401 100755 --- a/build/teamcity/internal/release/process/make-and-publish-build-artifacts.sh +++ b/build/teamcity/internal/release/process/make-and-publish-build-artifacts.sh @@ -15,7 +15,6 @@ release_branch="$(echo "$build_name" | grep -Eo "^v[0-9]+\.[0-9]+" || echo"")" is_custom_build="$(echo "$TC_BUILD_BRANCH" | grep -Eo "^custombuild-" || echo "")" if [[ -z "${DRY_RUN}" ]] ; then - bucket="cockroach-builds" gcs_bucket="cockroach-builds-artifacts-prod" google_credentials=$GOOGLE_COCKROACH_CLOUD_IMAGES_COCKROACHDB_CREDENTIALS gcr_repository="us-docker.pkg.dev/cockroach-cloud-images/cockroachdb/cockroach" @@ -24,7 +23,6 @@ if [[ -z "${DRY_RUN}" ]] ; then # export the variable to avoid shell escaping export gcs_credentials="$GCS_CREDENTIALS_PROD" else - bucket="cockroach-builds-test" gcs_bucket="cockroach-builds-artifacts-dryrun" google_credentials="$GOOGLE_COCKROACH_RELEASE_CREDENTIALS" gcr_repository="us.gcr.io/cockroach-release/cockroach-test" @@ -40,7 +38,6 @@ cat << EOF build_name: $build_name release_branch: $release_branch is_custom_build: $is_custom_build - bucket: $bucket gcs_bucket: $gcs_bucket gcr_repository: $gcr_repository @@ -54,17 +51,17 @@ tc_start_block "Tag the release" git tag "${build_name}" tc_end_block "Tag the release" -tc_start_block "Compile and publish S3 artifacts" -BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH=$build_name -e bucket=$bucket -e gcs_credentials -e gcs_bucket=$gcs_bucket" run_bazel << 'EOF' +tc_start_block "Compile and publish artifacts" +BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH=$build_name -e gcs_credentials -e gcs_bucket=$gcs_bucket" run_bazel << 'EOF' bazel build --config ci //pkg/cmd/publish-provisional-artifacts BAZEL_BIN=$(bazel info bazel-bin --config ci) export google_credentials="$gcs_credentials" source "build/teamcity-support.sh" # For log_into_gcloud log_into_gcloud export GOOGLE_APPLICATION_CREDENTIALS="$PWD/.google-credentials.json" -$BAZEL_BIN/pkg/cmd/publish-provisional-artifacts/publish-provisional-artifacts_/publish-provisional-artifacts -provisional -release -bucket "$bucket" --gcs-bucket="$gcs_bucket" +$BAZEL_BIN/pkg/cmd/publish-provisional-artifacts/publish-provisional-artifacts_/publish-provisional-artifacts -provisional -release --gcs-bucket="$gcs_bucket" EOF -tc_end_block "Compile and publish S3 artifacts" +tc_end_block "Compile and publish artifacts" tc_start_block "Make and push multiarch docker images" configure_docker_creds diff --git a/build/teamcity/internal/release/process/publish-cockroach-release.sh b/build/teamcity/internal/release/process/publish-cockroach-release.sh index e34fd724e397..84194f943157 100755 --- a/build/teamcity/internal/release/process/publish-cockroach-release.sh +++ b/build/teamcity/internal/release/process/publish-cockroach-release.sh @@ -24,7 +24,6 @@ fi release_branch=$(echo ${build_name} | grep -E -o '^v[0-9]+\.[0-9]+') if [[ -z "${DRY_RUN}" ]] ; then - bucket="binaries.cockroachdb.com" gcs_bucket="cockroach-release-artifacts-prod" google_credentials="$GOOGLE_COCKROACH_CLOUD_IMAGES_COCKROACHDB_CREDENTIALS" # export the variable to avoid shell escaping @@ -39,7 +38,6 @@ if [[ -z "${DRY_RUN}" ]] ; then gcr_hostname="us-docker.pkg.dev" git_repo_for_tag="cockroachdb/cockroach" else - bucket="cockroach-builds-test" gcs_bucket="cockroach-release-artifacts-dryrun" google_credentials="$GOOGLE_COCKROACH_RELEASE_CREDENTIALS" # export the variable to avoid shell escaping @@ -79,19 +77,19 @@ git tag "${build_name}" tc_end_block "Tag the release" -tc_start_block "Make and publish release S3 artifacts" +tc_start_block "Make and publish release artifacts" # Using publish-provisional-artifacts here is funky. We're directly publishing # the official binaries, not provisional ones. Legacy naming. To clean up... -BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH=$build_name -e bucket=$bucket -e gcs_credentials -e gcs_bucket=$gcs_bucket" run_bazel << 'EOF' +BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH=$build_name -e gcs_credentials -e gcs_bucket=$gcs_bucket" run_bazel << 'EOF' bazel build --config ci //pkg/cmd/publish-provisional-artifacts BAZEL_BIN=$(bazel info bazel-bin --config ci) export google_credentials="$gcs_credentials" source "build/teamcity-support.sh" # For log_into_gcloud log_into_gcloud export GOOGLE_APPLICATION_CREDENTIALS="$PWD/.google-credentials.json" -$BAZEL_BIN/pkg/cmd/publish-provisional-artifacts/publish-provisional-artifacts_/publish-provisional-artifacts -provisional -release -bucket "$bucket" --gcs-bucket="$gcs_bucket" +$BAZEL_BIN/pkg/cmd/publish-provisional-artifacts/publish-provisional-artifacts_/publish-provisional-artifacts -provisional -release --gcs-bucket="$gcs_bucket" EOF -tc_end_block "Make and publish release S3 artifacts" +tc_end_block "Make and publish release artifacts" tc_start_block "Make and push multiarch docker images" @@ -167,35 +165,35 @@ git_wrapped push "ssh://git@github.com/${git_repo_for_tag}.git" "$build_name" tc_end_block "Push release tag to GitHub" -tc_start_block "Publish S3 binaries and archive as latest-RELEASE_BRANCH" +tc_start_block "Publish binaries and archive as latest-RELEASE_BRANCH" # example: v20.1-latest if [[ -z "$PRE_RELEASE" ]]; then #TODO: implement me! - echo "Pushing latest-RELEASE_BRANCH S3 binaries and archive is not implemented." + echo "Pushing latest-RELEASE_BRANCH binaries and archive is not implemented." else - echo "Pushing latest-RELEASE_BRANCH S3 binaries and archive is not implemented." + echo "Pushing latest-RELEASE_BRANCH binaries and archive is not implemented." fi -tc_end_block "Publish S3 binaries and archive as latest-RELEASE_BRANCH" +tc_end_block "Publish binaries and archive as latest-RELEASE_BRANCH" -tc_start_block "Publish S3 binaries and archive as latest" +tc_start_block "Publish binaries and archive as latest" # Only push the "latest" for our most recent release branch. # https://github.com/cockroachdb/cockroach/issues/41067 if [[ -n "${PUBLISH_LATEST}" && -z "${PRE_RELEASE}" ]]; then - BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH=$build_name -e bucket=$bucket -e gcs_credentials -e gcs_bucket=$gcs_bucket" run_bazel << 'EOF' + BAZEL_SUPPORT_EXTRA_DOCKER_ARGS="-e TC_BUILDTYPE_ID -e TC_BUILD_BRANCH=$build_name -e gcs_credentials -e gcs_bucket=$gcs_bucket" run_bazel << 'EOF' bazel build --config ci //pkg/cmd/publish-provisional-artifacts BAZEL_BIN=$(bazel info bazel-bin --config ci) export google_credentials="$gcs_credentials" source "build/teamcity-support.sh" # For log_into_gcloud log_into_gcloud export GOOGLE_APPLICATION_CREDENTIALS="$PWD/.google-credentials.json" -$BAZEL_BIN/pkg/cmd/publish-provisional-artifacts/publish-provisional-artifacts_/publish-provisional-artifacts -bless -release -bucket "$bucket" --gcs-bucket="$gcs_bucket" +$BAZEL_BIN/pkg/cmd/publish-provisional-artifacts/publish-provisional-artifacts_/publish-provisional-artifacts -bless -release --gcs-bucket="$gcs_bucket" EOF else - echo "The latest S3 binaries and archive were _not_ updated." + echo "The latest binaries and archive were _not_ updated." fi -tc_end_block "Publish S3 binaries and archive as latest" +tc_end_block "Publish binaries and archive as latest" tc_start_block "Tag docker image as latest-RELEASE_BRANCH" diff --git a/pkg/cmd/cloudupload/main.go b/pkg/cmd/cloudupload/main.go index ab48c76866cc..667b22d1a3a1 100644 --- a/pkg/cmd/cloudupload/main.go +++ b/pkg/cmd/cloudupload/main.go @@ -39,10 +39,6 @@ func main() { Body: handler, } switch parsedDst.provider { - case "s3": - if err := s3Upload(parsedDst.bucket, dstObj); err != nil { - log.Fatalf("failed to upload %s to %s: %s", src, dst, err) - } case "gs": if err := gcsUpload(parsedDst.bucket, dstObj); err != nil { log.Fatalf("failed to upload %s to %s: %s", src, dst, err) @@ -70,25 +66,6 @@ func parseURL(dst string) (target, error) { }, nil } -func s3Upload(bucket string, dstObj release.PutObjectInput) error { - if _, ok := os.LookupEnv("AWS_ACCESS_KEY_ID"); !ok { - return fmt.Errorf("AWS_ACCESS_KEY_ID environment variable is not set") - } - if _, ok := os.LookupEnv("AWS_SECRET_ACCESS_KEY"); !ok { - return fmt.Errorf("AWS_SECRET_ACCESS_KEY environment variable is not set") - } - s3, err := release.NewS3("us-east-1", bucket) - if err != nil { - return fmt.Errorf("creating AWS S3 session: %w", err) - } - // Make sure the object doesn't exist. Potentially can race. - obj := release.GetObjectInput{Key: dstObj.Key} - if _, err := s3.GetObject(&obj); err == nil { - return fmt.Errorf("cannot overwrite %s in bucket %s", *dstObj.Key, bucket) - } - return s3.PutObject(&dstObj) -} - func gcsUpload(bucket string, dstObj release.PutObjectInput) error { if _, ok := os.LookupEnv("GOOGLE_APPLICATION_CREDENTIALS"); !ok { return fmt.Errorf("GOOGLE_APPLICATION_CREDENTIALS environment variable is not set") diff --git a/pkg/cmd/publish-artifacts/main.go b/pkg/cmd/publish-artifacts/main.go index 282d0d333b9c..26274766b9fa 100644 --- a/pkg/cmd/publish-artifacts/main.go +++ b/pkg/cmd/publish-artifacts/main.go @@ -23,15 +23,11 @@ import ( ) const ( - awsAccessKeyIDKey = "AWS_ACCESS_KEY_ID" - awsSecretAccessKeyKey = "AWS_SECRET_ACCESS_KEY" teamcityBuildBranchKey = "TC_BUILD_BRANCH" ) func main() { - var s3Bucket string var gcsBucket string - flag.StringVar(&s3Bucket, "bucket", "", "S3 bucket") flag.StringVar(&gcsBucket, "gcs-bucket", "", "GCS bucket") flag.Parse() @@ -45,25 +41,7 @@ func main() { if err != nil { log.Fatalf("Creating GCS session: %s", err) } - var providers []release.ObjectPutGetter - providers = append(providers, gcs) - - if s3Bucket != "" { - log.Printf("Using S3 bucket: %s", s3Bucket) - if _, ok := os.LookupEnv(awsAccessKeyIDKey); !ok { - log.Fatalf("AWS access key ID environment variable %s is not set", awsAccessKeyIDKey) - } - if _, ok := os.LookupEnv(awsSecretAccessKeyKey); !ok { - log.Fatalf("AWS secret access key environment variable %s is not set", awsSecretAccessKeyKey) - } - s3, err := release.NewS3("us-east-1", s3Bucket) - if err != nil { - log.Fatalf("Creating AWS S3 session: %s", err) - } - providers = append(providers, s3) - } else { - log.Println("Not using S3 bucket") - } + providers := []release.ObjectPutGetter{gcs} branch, ok := os.LookupEnv(teamcityBuildBranchKey) if !ok { diff --git a/pkg/cmd/publish-artifacts/main_test.go b/pkg/cmd/publish-artifacts/main_test.go index 52da4d0b1402..2efda1057601 100644 --- a/pkg/cmd/publish-artifacts/main_test.go +++ b/pkg/cmd/publish-artifacts/main_test.go @@ -33,7 +33,7 @@ type mockStorage struct { var _ release.ObjectPutGetter = (*mockStorage)(nil) func (s *mockStorage) Bucket() string { - return "cockroach" + return "edge-binaries-bucket" } func (s mockStorage) URL(key string) string { @@ -45,7 +45,7 @@ func (s *mockStorage) GetObject(*release.GetObjectInput) (*release.GetObjectOutp } func (s *mockStorage) PutObject(i *release.PutObjectInput) error { - url := fmt.Sprintf(`s3://%s/%s`, s.Bucket(), *i.Key) + url := fmt.Sprintf(`gs://%s/%s`, s.Bucket(), *i.Key) if i.CacheControl != nil { url += `/` + *i.CacheControl } @@ -172,96 +172,96 @@ func TestPublish(t *testing.T) { "env=[] args=bazel info bazel-bin -c opt --config=crosslinux --config=ci", }, expectedPuts: []string{ - "s3://cockroach/cockroach/cockroach.linux-gnu-amd64.1234567890abcdef CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach.linux-gnu-amd64.1234567890abcdef CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-pc-linux-gnu official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", - "s3://cockroach/cockroach/cockroach.linux-gnu-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach.linux-gnu-amd64.1234567890abcdef", - "s3://cockroach/cockroach/cockroach-sql.linux-gnu-amd64.1234567890abcdef CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach.linux-gnu-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach.linux-gnu-amd64.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.linux-gnu-amd64.1234567890abcdef CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-pc-linux-gnu official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", - "s3://cockroach/cockroach/cockroach-sql.linux-gnu-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.linux-gnu-amd64.1234567890abcdef", - "s3://cockroach/cockroach/lib/libgeos.linux-gnu-amd64.1234567890abcdef.so CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach-sql.linux-gnu-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.linux-gnu-amd64.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.linux-gnu-amd64.1234567890abcdef.so CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-pc-linux-gnu official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", - "s3://cockroach/cockroach/lib/libgeos.linux-gnu-amd64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.linux-gnu-amd64.1234567890abcdef.so", - "s3://cockroach/cockroach/lib/libgeos_c.linux-gnu-amd64.1234567890abcdef.so CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.linux-gnu-amd64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.linux-gnu-amd64.1234567890abcdef.so", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.linux-gnu-amd64.1234567890abcdef.so CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-pc-linux-gnu official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", - "s3://cockroach/cockroach/lib/libgeos_c.linux-gnu-amd64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.linux-gnu-amd64.1234567890abcdef.so", - "s3://cockroach/cockroach/cockroach.linux-gnu-aarch64.1234567890abcdef CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.linux-gnu-amd64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.linux-gnu-amd64.1234567890abcdef.so", + "gs://edge-binaries-bucket/cockroach/cockroach.linux-gnu-aarch64.1234567890abcdef CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh aarch64-unknown-linux-gnu official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", - "s3://cockroach/cockroach/cockroach.linux-gnu-aarch64.LATEST/no-cache REDIRECT /cockroach/cockroach.linux-gnu-aarch64.1234567890abcdef", - "s3://cockroach/cockroach/cockroach-sql.linux-gnu-aarch64.1234567890abcdef CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach.linux-gnu-aarch64.LATEST/no-cache REDIRECT /cockroach/cockroach.linux-gnu-aarch64.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.linux-gnu-aarch64.1234567890abcdef CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh aarch64-unknown-linux-gnu official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", - "s3://cockroach/cockroach/cockroach-sql.linux-gnu-aarch64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.linux-gnu-aarch64.1234567890abcdef", - "s3://cockroach/cockroach/lib/libgeos.linux-gnu-aarch64.1234567890abcdef.so CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach-sql.linux-gnu-aarch64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.linux-gnu-aarch64.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.linux-gnu-aarch64.1234567890abcdef.so CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh aarch64-unknown-linux-gnu official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", - "s3://cockroach/cockroach/lib/libgeos.linux-gnu-aarch64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.linux-gnu-aarch64.1234567890abcdef.so", - "s3://cockroach/cockroach/lib/libgeos_c.linux-gnu-aarch64.1234567890abcdef.so CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.linux-gnu-aarch64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.linux-gnu-aarch64.1234567890abcdef.so", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.linux-gnu-aarch64.1234567890abcdef.so CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh aarch64-unknown-linux-gnu official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", - "s3://cockroach/cockroach/lib/libgeos_c.linux-gnu-aarch64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.linux-gnu-aarch64.1234567890abcdef.so", - "s3://cockroach/cockroach/cockroach.darwin-amd64.1234567890abcdef CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.linux-gnu-aarch64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.linux-gnu-aarch64.1234567890abcdef.so", + "gs://edge-binaries-bucket/cockroach/cockroach.darwin-amd64.1234567890abcdef CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-apple-darwin19 official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", - "s3://cockroach/cockroach/cockroach.darwin-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach.darwin-amd64.1234567890abcdef", - "s3://cockroach/cockroach/cockroach-sql.darwin-amd64.1234567890abcdef CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach.darwin-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach.darwin-amd64.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.darwin-amd64.1234567890abcdef CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-apple-darwin19 official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", - "s3://cockroach/cockroach/cockroach-sql.darwin-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.darwin-amd64.1234567890abcdef", - "s3://cockroach/cockroach/lib/libgeos.darwin-amd64.1234567890abcdef.dylib CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach-sql.darwin-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.darwin-amd64.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.darwin-amd64.1234567890abcdef.dylib CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-apple-darwin19 official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", - "s3://cockroach/cockroach/lib/libgeos.darwin-amd64.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.darwin-amd64.1234567890abcdef.dylib", - "s3://cockroach/cockroach/lib/libgeos_c.darwin-amd64.1234567890abcdef.dylib CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.darwin-amd64.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.darwin-amd64.1234567890abcdef.dylib", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.darwin-amd64.1234567890abcdef.dylib CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-apple-darwin19 official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", - "s3://cockroach/cockroach/lib/libgeos_c.darwin-amd64.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.darwin-amd64.1234567890abcdef.dylib", - "s3://cockroach/cockroach/cockroach.darwin-aarch64.unsigned.1234567890abcdef CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", - "s3://cockroach/cockroach/cockroach.darwin-aarch64.unsigned.LATEST/no-cache REDIRECT /cockroach/cockroach.darwin-aarch64.unsigned.1234567890abcdef", - "s3://cockroach/cockroach/cockroach-sql.darwin-aarch64.unsigned.1234567890abcdef CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", - "s3://cockroach/cockroach/cockroach-sql.darwin-aarch64.unsigned.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.darwin-aarch64.unsigned.1234567890abcdef", - "s3://cockroach/cockroach/lib/libgeos.darwin-aarch64.unsigned.1234567890abcdef.dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", - "s3://cockroach/cockroach/lib/libgeos.darwin-aarch64.unsigned.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.darwin-aarch64.unsigned.1234567890abcdef.dylib", - "s3://cockroach/cockroach/lib/libgeos_c.darwin-aarch64.unsigned.1234567890abcdef.dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", - "s3://cockroach/cockroach/lib/libgeos_c.darwin-aarch64.unsigned.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.darwin-aarch64.unsigned.1234567890abcdef.dylib", - "s3://cockroach/cockroach/cockroach.windows-amd64.1234567890abcdef.exe CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.darwin-amd64.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.darwin-amd64.1234567890abcdef.dylib", + "gs://edge-binaries-bucket/cockroach/cockroach.darwin-aarch64.unsigned.1234567890abcdef CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", + "gs://edge-binaries-bucket/cockroach/cockroach.darwin-aarch64.unsigned.LATEST/no-cache REDIRECT /cockroach/cockroach.darwin-aarch64.unsigned.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.darwin-aarch64.unsigned.1234567890abcdef CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.darwin-aarch64.unsigned.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.darwin-aarch64.unsigned.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.darwin-aarch64.unsigned.1234567890abcdef.dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.darwin-aarch64.unsigned.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.darwin-aarch64.unsigned.1234567890abcdef.dylib", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.darwin-aarch64.unsigned.1234567890abcdef.dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.darwin-aarch64.unsigned.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.darwin-aarch64.unsigned.1234567890abcdef.dylib", + "gs://edge-binaries-bucket/cockroach/cockroach.windows-amd64.1234567890abcdef.exe CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32 official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", - "s3://cockroach/cockroach/cockroach.windows-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach.windows-amd64.1234567890abcdef.exe", - "s3://cockroach/cockroach/cockroach-sql.windows-amd64.1234567890abcdef.exe CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach.windows-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach.windows-amd64.1234567890abcdef.exe", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.windows-amd64.1234567890abcdef.exe CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32 official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", - "s3://cockroach/cockroach/cockroach-sql.windows-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.windows-amd64.1234567890abcdef.exe", - "s3://cockroach/cockroach/lib/libgeos.windows-amd64.1234567890abcdef.dll CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/cockroach-sql.windows-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.windows-amd64.1234567890abcdef.exe", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.windows-amd64.1234567890abcdef.dll CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32 official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", - "s3://cockroach/cockroach/lib/libgeos.windows-amd64.dll.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.windows-amd64.1234567890abcdef.dll", - "s3://cockroach/cockroach/lib/libgeos_c.windows-amd64.1234567890abcdef.dll CONTENTS env=[] args=bazel build " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.windows-amd64.dll.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.windows-amd64.1234567890abcdef.dll", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.windows-amd64.1234567890abcdef.dll CONTENTS env=[] args=bazel build " + "//pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32 official-binary' " + "-c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", - "s3://cockroach/cockroach/lib/libgeos_c.windows-amd64.dll.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.windows-amd64.1234567890abcdef.dll", - "s3://cockroach/cockroach/workload.1234567890abcdef CONTENTS env=[] args=bazel build //pkg/cmd/workload -c opt --config=crosslinux --config=ci", - "s3://cockroach/cockroach/workload.LATEST/no-cache REDIRECT /cockroach/workload.1234567890abcdef", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.windows-amd64.dll.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.windows-amd64.1234567890abcdef.dll", + "gs://edge-binaries-bucket/cockroach/workload.1234567890abcdef CONTENTS env=[] args=bazel build //pkg/cmd/workload -c opt --config=crosslinux --config=ci", + "gs://edge-binaries-bucket/cockroach/workload.LATEST/no-cache REDIRECT /cockroach/workload.1234567890abcdef", }, }, } @@ -270,7 +270,6 @@ func TestPublish(t *testing.T) { dir, cleanup := testutils.TempDir(t) defer cleanup() - var s3 mockStorage var gcs mockStorage var runner mockExecRunner fakeBazelBin, cleanup := testutils.TempDir(t) @@ -279,9 +278,8 @@ func TestPublish(t *testing.T) { flags := test.flags flags.pkgDir = dir execFn := release.ExecFn{MockExecFn: runner.run} - run([]release.ObjectPutGetter{&s3, &gcs}, flags, execFn) + run([]release.ObjectPutGetter{&gcs}, flags, execFn) require.Equal(t, test.expectedCmds, runner.cmds) - require.Equal(t, test.expectedPuts, s3.puts) require.Equal(t, test.expectedPuts, gcs.puts) }) } diff --git a/pkg/cmd/publish-provisional-artifacts/main.go b/pkg/cmd/publish-provisional-artifacts/main.go index f0ab2d2b2654..b2ff6fa38233 100644 --- a/pkg/cmd/publish-provisional-artifacts/main.go +++ b/pkg/cmd/publish-provisional-artifacts/main.go @@ -25,21 +25,17 @@ import ( ) const ( - awsAccessKeyIDKey = "AWS_ACCESS_KEY_ID" - awsSecretAccessKeyKey = "AWS_SECRET_ACCESS_KEY" teamcityBuildBranchKey = "TC_BUILD_BRANCH" ) var provisionalReleasePrefixRE = regexp.MustCompile(`^provisional_[0-9]{12}_`) func main() { - var s3Bucket string var gcsBucket string var doProvisional bool var isRelease bool var doBless bool flag.BoolVar(&isRelease, "release", false, "build in release mode instead of bleeding-edge mode") - flag.StringVar(&s3Bucket, "bucket", "", "S3 bucket") flag.StringVar(&gcsBucket, "gcs-bucket", "", "GCS bucket") flag.BoolVar(&doProvisional, "provisional", false, "publish provisional binaries") flag.BoolVar(&doBless, "bless", false, "bless provisional binaries") @@ -47,8 +43,6 @@ func main() { flag.Parse() log.SetFlags(log.LstdFlags | log.Lshortfile) - var providers []release.ObjectPutGetter - // GCS bucket is required now if gcsBucket == "" { log.Fatal("GCS bucket not specified") @@ -60,24 +54,7 @@ func main() { if err != nil { log.Fatalf("Creating GCS session: %s", err) } - providers = append(providers, gcs) - - if s3Bucket != "" { - log.Printf("Using S3 bucket: %s", s3Bucket) - if _, ok := os.LookupEnv(awsAccessKeyIDKey); !ok { - log.Fatalf("AWS access key ID environment variable %s is not set", awsAccessKeyIDKey) - } - if _, ok := os.LookupEnv(awsSecretAccessKeyKey); !ok { - log.Fatalf("AWS secret access key environment variable %s is not set", awsSecretAccessKeyKey) - } - s3, err := release.NewS3("us-east-1", s3Bucket) - if err != nil { - log.Fatalf("Creating AWS S3 session: %s", err) - } - providers = append(providers, s3) - } else { - log.Println("WARN: no S3 bucket defined, skipping...") - } + providers := []release.ObjectPutGetter{gcs} branch, ok := os.LookupEnv(teamcityBuildBranchKey) if !ok { diff --git a/pkg/cmd/publish-provisional-artifacts/main_test.go b/pkg/cmd/publish-provisional-artifacts/main_test.go index ca5ad75a3868..203ec22bd1f1 100644 --- a/pkg/cmd/publish-provisional-artifacts/main_test.go +++ b/pkg/cmd/publish-provisional-artifacts/main_test.go @@ -44,7 +44,7 @@ func (s mockStorage) URL(key string) string { } func (s *mockStorage) GetObject(i *release.GetObjectInput) (*release.GetObjectOutput, error) { - url := fmt.Sprintf(`s3://%s/%s`, s.Bucket(), *i.Key) + url := fmt.Sprintf(`gs://%s/%s`, s.Bucket(), *i.Key) s.gets = append(s.gets, url) o := &release.GetObjectOutput{ Body: io.NopCloser(bytes.NewBufferString(url)), @@ -53,7 +53,7 @@ func (s *mockStorage) GetObject(i *release.GetObjectInput) (*release.GetObjectOu } func (s *mockStorage) PutObject(i *release.PutObjectInput) error { - url := fmt.Sprintf(`s3://%s/%s`, s.Bucket(), *i.Key) + url := fmt.Sprintf(`gs://%s/%s`, s.Bucket(), *i.Key) if i.CacheControl != nil { url += `/` + *i.CacheControl } @@ -181,27 +181,27 @@ func TestProvisional(t *testing.T) { }, expectedGets: nil, expectedPuts: []string{ - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.linux-amd64.tgz " + + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.linux-amd64.tgz " + "CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.linux-amd64.tgz.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.linux-amd64.tgz CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.linux-amd64.tgz.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.darwin-10.9-amd64.tgz CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.darwin-10.9-amd64.tgz.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.darwin-10.9-amd64.tgz CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.darwin-10.9-amd64.tgz.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.darwin-11.0-aarch64.unsigned.tgz CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.darwin-11.0-aarch64.unsigned.tgz.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.darwin-11.0-aarch64.unsigned.tgz CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.darwin-11.0-aarch64.unsigned.tgz.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.windows-6.2-amd64.zip CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.windows-6.2-amd64.zip.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.windows-6.2-amd64.zip CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.windows-6.2-amd64.zip.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.linux-3.7.10-gnu-aarch64.tgz CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-v0.0.1-alpha.linux-3.7.10-gnu-aarch64.tgz.sha256sum CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.linux-3.7.10-gnu-aarch64.tgz CONTENTS ", - "s3://binaries.cockroachdb.com/cockroach-sql-v0.0.1-alpha.linux-3.7.10-gnu-aarch64.tgz.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.linux-amd64.tgz.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.linux-amd64.tgz CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.linux-amd64.tgz.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.darwin-10.9-amd64.tgz CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.darwin-10.9-amd64.tgz.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.darwin-10.9-amd64.tgz CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.darwin-10.9-amd64.tgz.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.darwin-11.0-aarch64.unsigned.tgz CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.darwin-11.0-aarch64.unsigned.tgz.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.darwin-11.0-aarch64.unsigned.tgz CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.darwin-11.0-aarch64.unsigned.tgz.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.windows-6.2-amd64.zip CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.windows-6.2-amd64.zip.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.windows-6.2-amd64.zip CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.windows-6.2-amd64.zip.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.linux-3.7.10-gnu-aarch64.tgz CONTENTS ", + "gs://release-binaries-bucket/cockroach-v0.0.1-alpha.linux-3.7.10-gnu-aarch64.tgz.sha256sum CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.linux-3.7.10-gnu-aarch64.tgz CONTENTS ", + "gs://release-binaries-bucket/cockroach-sql-v0.0.1-alpha.linux-3.7.10-gnu-aarch64.tgz.sha256sum CONTENTS ", }, }, { @@ -234,79 +234,79 @@ func TestProvisional(t *testing.T) { }, expectedGets: nil, expectedPuts: []string{ - "s3://cockroach/cockroach/cockroach.linux-gnu-amd64.00SHA00 " + + "gs://edge-binaries-bucket/cockroach/cockroach.linux-gnu-amd64.00SHA00 " + "CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp." + "sh x86_64-pc-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", - "s3://cockroach/cockroach/cockroach.linux-gnu-amd64.LATEST/no-cache " + + "gs://edge-binaries-bucket/cockroach/cockroach.linux-gnu-amd64.LATEST/no-cache " + "REDIRECT /cockroach/cockroach.linux-gnu-amd64.00SHA00", - "s3://cockroach/cockroach/cockroach-sql.linux-gnu-amd64.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-pc-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", - "s3://cockroach/cockroach/cockroach-sql.linux-gnu-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.linux-gnu-amd64.00SHA00", - "s3://cockroach/cockroach/lib/libgeos.linux-gnu-amd64.00SHA00." + + "gs://edge-binaries-bucket/cockroach/cockroach-sql.linux-gnu-amd64.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-pc-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.linux-gnu-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.linux-gnu-amd64.00SHA00", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.linux-gnu-amd64.00SHA00." + "so CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-pc-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", - "s3://cockroach/cockroach/lib/libgeos.linux-gnu-amd64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.linux-gnu-amd64.00SHA00.so", - "s3://cockroach/cockroach/lib/libgeos_c.linux-gnu-amd64.00SHA00." + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.linux-gnu-amd64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.linux-gnu-amd64.00SHA00.so", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.linux-gnu-amd64.00SHA00." + "so CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-pc-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxbase", - "s3://cockroach/cockroach/lib/libgeos_c.linux-gnu-amd64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.linux-gnu-amd64.00SHA00.so", - "s3://cockroach/cockroach/cockroach.darwin-amd64.00SHA00 " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.linux-gnu-amd64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.linux-gnu-amd64.00SHA00.so", + "gs://edge-binaries-bucket/cockroach/cockroach.darwin-amd64.00SHA00 " + "CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-apple-darwin19 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", - "s3://cockroach/cockroach/cockroach.darwin-amd64.LATEST/no-cache " + + "gs://edge-binaries-bucket/cockroach/cockroach.darwin-amd64.LATEST/no-cache " + "REDIRECT /cockroach/cockroach.darwin-amd64.00SHA00", - "s3://cockroach/cockroach/cockroach-sql.darwin-amd64.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-apple-darwin19 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", - "s3://cockroach/cockroach/cockroach-sql.darwin-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql." + + "gs://edge-binaries-bucket/cockroach/cockroach-sql.darwin-amd64.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-apple-darwin19 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.darwin-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql." + "darwin-amd64.00SHA00", - "s3://cockroach/cockroach/lib/libgeos.darwin-amd64.00SHA00." + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.darwin-amd64.00SHA00." + "dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-apple-darwin19 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", - "s3://cockroach/cockroach/lib/libgeos.darwin-amd64.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.darwin-amd64.00SHA00.dylib", - "s3://cockroach/cockroach/lib/libgeos_c.darwin-amd64.00SHA00." + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.darwin-amd64.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.darwin-amd64.00SHA00.dylib", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.darwin-amd64.00SHA00." + "dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp." + "sh x86_64-apple-darwin19 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosbase", - "s3://cockroach/cockroach/lib/libgeos_c.darwin-amd64.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.darwin-amd64.00SHA00.dylib", - "s3://cockroach/cockroach/cockroach.darwin-aarch64.unsigned.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", - "s3://cockroach/cockroach/cockroach.darwin-aarch64.unsigned.LATEST/no-cache REDIRECT /cockroach/cockroach.darwin-aarch64.unsigned.00SHA00", - "s3://cockroach/cockroach/cockroach-sql.darwin-aarch64.unsigned.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", - "s3://cockroach/cockroach/cockroach-sql.darwin-aarch64.unsigned.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.darwin-aarch64.unsigned.00SHA00", - "s3://cockroach/cockroach/lib/libgeos.darwin-aarch64.unsigned.00SHA00.dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", - "s3://cockroach/cockroach/lib/libgeos.darwin-aarch64.unsigned.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.darwin-aarch64.unsigned.00SHA00.dylib", - "s3://cockroach/cockroach/lib/libgeos_c.darwin-aarch64.unsigned.00SHA00.dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", - "s3://cockroach/cockroach/lib/libgeos_c.darwin-aarch64.unsigned.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.darwin-aarch64.unsigned.00SHA00.dylib", - "s3://cockroach/cockroach/cockroach.windows-amd64.00SHA00.exe " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.darwin-amd64.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.darwin-amd64.00SHA00.dylib", + "gs://edge-binaries-bucket/cockroach/cockroach.darwin-aarch64.unsigned.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", + "gs://edge-binaries-bucket/cockroach/cockroach.darwin-aarch64.unsigned.LATEST/no-cache REDIRECT /cockroach/cockroach.darwin-aarch64.unsigned.00SHA00", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.darwin-aarch64.unsigned.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.darwin-aarch64.unsigned.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.darwin-aarch64.unsigned.00SHA00", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.darwin-aarch64.unsigned.00SHA00.dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.darwin-aarch64.unsigned.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.darwin-aarch64.unsigned.00SHA00.dylib", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.darwin-aarch64.unsigned.00SHA00.dylib CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-apple-darwin21.2 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crossmacosarmbase", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.darwin-aarch64.unsigned.dylib.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.darwin-aarch64.unsigned.00SHA00.dylib", + "gs://edge-binaries-bucket/cockroach/cockroach.windows-amd64.00SHA00.exe " + "CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp." + "sh x86_64-w64-mingw32 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", - "s3://cockroach/cockroach/cockroach.windows-amd64.LATEST/no-cache " + + "gs://edge-binaries-bucket/cockroach/cockroach.windows-amd64.LATEST/no-cache " + "REDIRECT /cockroach/cockroach.windows-amd64.00SHA00.exe", - "s3://cockroach/cockroach/cockroach-sql.windows-amd64.00SHA00.exe CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", - "s3://cockroach/cockroach/cockroach-sql.windows-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.windows-amd64.00SHA00.exe", - "s3://cockroach/cockroach/lib/libgeos.windows-amd64.00SHA00." + + "gs://edge-binaries-bucket/cockroach/cockroach-sql.windows-amd64.00SHA00.exe CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.windows-amd64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.windows-amd64.00SHA00.exe", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.windows-amd64.00SHA00." + "dll CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", - "s3://cockroach/cockroach/lib/libgeos.windows-amd64.dll.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.windows-amd64.00SHA00.dll", - "s3://cockroach/cockroach/lib/libgeos_c.windows-amd64.00SHA00." + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.windows-amd64.dll.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.windows-amd64.00SHA00.dll", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.windows-amd64.00SHA00." + "dll CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh x86_64-w64-mingw32 official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosswindowsbase", - "s3://cockroach/cockroach/lib/libgeos_c.windows-amd64.dll.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.windows-amd64.00SHA00.dll", - "s3://cockroach/cockroach/cockroach.linux-gnu-aarch64.00SHA00 " + + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.windows-amd64.dll.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.windows-amd64.00SHA00.dll", + "gs://edge-binaries-bucket/cockroach/cockroach.linux-gnu-aarch64.00SHA00 " + "CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp." + "sh aarch64-unknown-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", - "s3://cockroach/cockroach/cockroach.linux-gnu-aarch64.LATEST/no-cache " + + "gs://edge-binaries-bucket/cockroach/cockroach.linux-gnu-aarch64.LATEST/no-cache " + "REDIRECT /cockroach/cockroach.linux-gnu-aarch64.00SHA00", - "s3://cockroach/cockroach/cockroach-sql.linux-gnu-aarch64.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-unknown-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", - "s3://cockroach/cockroach/cockroach-sql.linux-gnu-aarch64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.linux-gnu-aarch64.00SHA00", - "s3://cockroach/cockroach/lib/libgeos.linux-gnu-aarch64.00SHA00." + + "gs://edge-binaries-bucket/cockroach/cockroach-sql.linux-gnu-aarch64.00SHA00 CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql '--workspace_status_command=./build/bazelutil/stamp.sh aarch64-unknown-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", + "gs://edge-binaries-bucket/cockroach/cockroach-sql.linux-gnu-aarch64.LATEST/no-cache REDIRECT /cockroach/cockroach-sql.linux-gnu-aarch64.00SHA00", + "gs://edge-binaries-bucket/cockroach/lib/libgeos.linux-gnu-aarch64.00SHA00." + "so CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh aarch64-unknown-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", - "s3://cockroach/cockroach/lib/libgeos.linux-gnu-aarch64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.linux-gnu-aarch64.00SHA00.so", - "s3://cockroach/cockroach/lib/libgeos_c.linux-gnu-aarch64.00SHA00." + + "gs://edge-binaries-bucket/cockroach/lib/libgeos.linux-gnu-aarch64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos.linux-gnu-aarch64.00SHA00.so", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.linux-gnu-aarch64.00SHA00." + "so CONTENTS env=[] args=bazel build //pkg/cmd/cockroach //c-deps:libgeos //pkg/cmd/cockroach-sql " + "'--workspace_status_command=./build/bazelutil/stamp.sh aarch64-unknown-linux-gnu official-binary' -c opt --config=ci --config=force_build_cdeps --config=with_ui --config=crosslinuxarmbase", - "s3://cockroach/cockroach/lib/libgeos_c.linux-gnu-aarch64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.linux-gnu-aarch64.00SHA00.so", + "gs://edge-binaries-bucket/cockroach/lib/libgeos_c.linux-gnu-aarch64.so.LATEST/no-cache REDIRECT /cockroach/lib/libgeos_c.linux-gnu-aarch64.00SHA00.so", }, }, } @@ -315,15 +315,10 @@ func TestProvisional(t *testing.T) { dir, cleanup := testutils.TempDir(t) defer cleanup() - var s3 mockStorage - s3.bucket = "cockroach" - if test.flags.isRelease { - s3.bucket = "binaries.cockroachdb.com" - } var gcs mockStorage - gcs.bucket = "cockroach" + gcs.bucket = "edge-binaries-bucket" if test.flags.isRelease { - gcs.bucket = "binaries.cockroachdb.com" + gcs.bucket = "release-binaries-bucket" } var runner mockExecRunner fakeBazelBin, cleanup := testutils.TempDir(t) @@ -332,10 +327,8 @@ func TestProvisional(t *testing.T) { flags := test.flags flags.pkgDir = dir execFn := release.ExecFn{MockExecFn: runner.run} - run([]release.ObjectPutGetter{&s3, &gcs}, flags, execFn) + run([]release.ObjectPutGetter{&gcs}, flags, execFn) require.Equal(t, test.expectedCmds, runner.cmds) - require.Equal(t, test.expectedGets, s3.gets) - require.Equal(t, test.expectedPuts, s3.puts) require.Equal(t, test.expectedGets, gcs.gets) require.Equal(t, test.expectedPuts, gcs.puts) }) @@ -368,25 +361,25 @@ func TestBless(t *testing.T) { }, expectedGets: nil, expectedPuts: []string{ - "s3://binaries.cockroachdb.com/cockroach-latest.linux-amd64.tgz/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.linux-amd64.tgz/no-cache " + "REDIRECT /cockroach-v0.0.1.linux-amd64.tgz", - "s3://binaries.cockroachdb.com/cockroach-latest.linux-amd64.tgz.sha256sum/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.linux-amd64.tgz.sha256sum/no-cache " + "REDIRECT /cockroach-v0.0.1.linux-amd64.tgz.sha256sum", - "s3://binaries.cockroachdb.com/cockroach-latest.darwin-10.9-amd64.tgz/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.darwin-10.9-amd64.tgz/no-cache " + "REDIRECT /cockroach-v0.0.1.darwin-10.9-amd64.tgz", - "s3://binaries.cockroachdb.com/cockroach-latest.darwin-10.9-amd64.tgz.sha256sum/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.darwin-10.9-amd64.tgz.sha256sum/no-cache " + "REDIRECT /cockroach-v0.0.1.darwin-10.9-amd64.tgz.sha256sum", - "s3://binaries.cockroachdb.com/cockroach-latest.darwin-11.0-aarch64.unsigned.tgz/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.darwin-11.0-aarch64.unsigned.tgz/no-cache " + "REDIRECT /cockroach-v0.0.1.darwin-11.0-aarch64.unsigned.tgz", - "s3://binaries.cockroachdb.com/cockroach-latest.darwin-11.0-aarch64.unsigned.tgz.sha256sum/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.darwin-11.0-aarch64.unsigned.tgz.sha256sum/no-cache " + "REDIRECT /cockroach-v0.0.1.darwin-11.0-aarch64.unsigned.tgz.sha256sum", - "s3://binaries.cockroachdb.com/cockroach-latest.windows-6.2-amd64.zip/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.windows-6.2-amd64.zip/no-cache " + "REDIRECT /cockroach-v0.0.1.windows-6.2-amd64.zip", - "s3://binaries.cockroachdb.com/cockroach-latest.windows-6.2-amd64.zip.sha256sum/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.windows-6.2-amd64.zip.sha256sum/no-cache " + "REDIRECT /cockroach-v0.0.1.windows-6.2-amd64.zip.sha256sum", - "s3://binaries.cockroachdb.com/cockroach-latest.linux-3.7.10-gnu-aarch64.tgz/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.linux-3.7.10-gnu-aarch64.tgz/no-cache " + "REDIRECT /cockroach-v0.0.1.linux-3.7.10-gnu-aarch64.tgz", - "s3://binaries.cockroachdb.com/cockroach-latest.linux-3.7.10-gnu-aarch64.tgz.sha256sum/no-cache " + + "gs://release-binaries-bucket/cockroach-latest.linux-3.7.10-gnu-aarch64.tgz.sha256sum/no-cache " + "REDIRECT /cockroach-v0.0.1.linux-3.7.10-gnu-aarch64.tgz.sha256sum", }, }, @@ -394,12 +387,12 @@ func TestBless(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - var s3 mockStorage - s3.bucket = "binaries.cockroachdb.com" + var gs mockStorage + gs.bucket = "release-binaries-bucket" var execFn release.ExecFn // bless shouldn't exec anything - run([]release.ObjectPutGetter{&s3}, test.flags, execFn) - require.Equal(t, test.expectedGets, s3.gets) - require.Equal(t, test.expectedPuts, s3.puts) + run([]release.ObjectPutGetter{&gs}, test.flags, execFn) + require.Equal(t, test.expectedGets, gs.gets) + require.Equal(t, test.expectedPuts, gs.puts) }) } } diff --git a/pkg/release/BUILD.bazel b/pkg/release/BUILD.bazel index 4ad6aec5be71..df10e3674e0e 100644 --- a/pkg/release/BUILD.bazel +++ b/pkg/release/BUILD.bazel @@ -7,16 +7,12 @@ go_library( "build.go", "gcs.go", "release.go", - "s3.go", "upload.go", ], importpath = "github.com/cockroachdb/cockroach/pkg/release", visibility = ["//visibility:public"], deps = [ "//pkg/build/util", - "@com_github_aws_aws_sdk_go//aws", - "@com_github_aws_aws_sdk_go//aws/session", - "@com_github_aws_aws_sdk_go//service/s3", "@com_github_cockroachdb_errors//:errors", "@com_google_cloud_go_storage//:storage", ], diff --git a/pkg/release/gcs.go b/pkg/release/gcs.go index 8828de53bb2a..1ee5ec5e146b 100644 --- a/pkg/release/gcs.go +++ b/pkg/release/gcs.go @@ -39,7 +39,7 @@ func NewGCS(bucket string) (*GCSProvider, error) { return provider, nil } -// GetObject implements object retrieval for S3 +// GetObject implements object retrieval for GCS func (p *GCSProvider) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { obj := p.client.Bucket(p.bucket).Object(*input.Key) ctx := context.Background() @@ -57,7 +57,7 @@ func (p *GCSProvider) Bucket() string { return p.bucket } -// PutObject implements object upload for S3 +// PutObject implements object upload for GCS func (p *GCSProvider) PutObject(input *PutObjectInput) error { obj := p.client.Bucket(p.bucket).Object(*input.Key) ctx := context.Background() diff --git a/pkg/release/s3.go b/pkg/release/s3.go deleted file mode 100644 index 6dce5d816d42..000000000000 --- a/pkg/release/s3.go +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2020 The Cockroach Authors. -// -// Use of this software is governed by the Business Source License -// included in the file licenses/BSL.txt. -// -// As of the Change Date specified in that file, in accordance with -// the Business Source License, use of this software will be governed -// by the Apache License, Version 2.0, included in the file -// licenses/APL.txt. - -package release - -import ( - "fmt" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/s3" -) - -// S3Provider is an implementation of the ObjectPutGetter interface for S3 -type S3Provider struct { - service *s3.S3 - bucket *string -} - -// NewS3 creates a new instance of S3Provider -func NewS3(region string, bucket string) (*S3Provider, error) { - sess, err := session.NewSession(&aws.Config{ - Region: aws.String(region), - }) - if err != nil { - return &S3Provider{}, err - } - return &S3Provider{ - service: s3.New(sess), - bucket: &bucket, - }, nil -} - -// GetObject implements object retrieval for S3 -func (p *S3Provider) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { - obj, err := p.service.GetObject(&s3.GetObjectInput{ - Bucket: p.bucket, - Key: input.Key, - }) - if err != nil { - return &GetObjectOutput{}, err - } - return &GetObjectOutput{ - Body: obj.Body, - }, nil -} - -// PutObject implements object upload for S3 -func (p *S3Provider) PutObject(input *PutObjectInput) error { - putObjectInput := s3.PutObjectInput{ - Bucket: p.bucket, - Key: input.Key, - Body: input.Body, - CacheControl: input.CacheControl, - ContentDisposition: input.ContentDisposition, - WebsiteRedirectLocation: input.WebsiteRedirectLocation, - } - if _, err := p.service.PutObject(&putObjectInput); err != nil { - return fmt.Errorf("s3 upload %s: %w", *input.Key, err) - } - return nil -} - -// Bucket returns bucket name -func (p *S3Provider) Bucket() string { - return *p.bucket -} - -// URL returns key's representation that can be used by AWS CLI -func (p S3Provider) URL(key string) string { - return "s3://" + *p.bucket + "/" + strings.TrimPrefix(key, "/") -} diff --git a/scripts/verify-release-binaries.sh b/scripts/verify-release-binaries.sh deleted file mode 100755 index 1104e7e28119..000000000000 --- a/scripts/verify-release-binaries.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -BETA_TAG=${1-} - -if [ -z ${BETA_TAG} ]; then - echo "usage: $0 " - exit 1 -fi - -darwin=".darwin-10.9-amd64" -linux=".linux-amd64" - -function check_aws() { - echo -n "aws binaries" - - local aws_bins=$(aws s3 ls s3://binaries.cockroachdb.com | - grep ${BETA_TAG} | awk '{print $NF}') - for suffix in ${darwin}.tgz ${linux}.tgz; do - if ! echo ${aws_bins} | grep -q ${suffix}; then - echo ": cockroach-${BETA_TAG}${suffix} not found" - exit 1 - fi - done - - echo ": ok" -} - -function verify_tag() { - if [ "$1" != "${BETA_TAG}" ]; then - echo ": expected ${BETA_TAG}, but found $1" - exit 1 - fi -} - -function check_linux() { - echo -n "linux binary" - - curl -s https://binaries.cockroachdb.com/cockroach-${BETA_TAG}${linux}.tgz | tar xz - local tag=$($(dirname $0)/../build/builder.sh ./cockroach-${BETA_TAG}${linux}/cockroach version | - grep 'Build Tag:' | awk '{print $NF}' | tr -d '\r') - if test -z "$tag"; then - # From v21.1 onwards. - tag=$($(dirname $0)/../build/builder.sh ./cockroach-${BETA_TAG}${linux}/cockroach version --build-tag | tr -d '\r') - fi - rm -fr ./cockroach-${BETA_TAG}${linux} - verify_tag "${tag}" - - echo ": ok" -} - -function check_darwin() { - echo -n "darwin binary" - - if [ "$(uname)" != "Darwin" ]; then - echo ": not checked" - return - fi - - curl -s https://binaries.cockroachdb.com/cockroach-${BETA_TAG}${darwin}.tgz | tar xz - local tag=$(./cockroach-${BETA_TAG}${darwin}/cockroach version | - grep 'Build Tag:' | awk '{print $NF}' | tr -d '\r') - if test -z "$tag"; then - # From v21.1 onwards. - tag=$(./cockroach-${BETA_TAG}${darwin}/cockroach version | tr -d '\r') - fi - rm -fr cockroach-${BETA_TAG}${darwin} - verify_tag "${tag}" - - echo ": ok" -} - -function check_docker() { - echo -n "docker" - - trap "rm -f docker.stderr" 0 - local tag=$(docker run --rm cockroachdb/cockroach:${BETA_TAG} version 2>docker.stderr | - grep 'Build Tag:' | awk '{print $NF}' | tr -d '\r') - if test -z "$tag"; then - # From v21.1 onwards. - tag=$(docker run --rm cockroachdb/cockroach:${BETA_TAG} version --build-tag 2>docker.stderr | tr -d '\r') - fi - if [ -z "${tag}" ]; then - echo - cat docker.stderr - exit 1 - fi - verify_tag "${tag}" - - echo ": ok" -} - -check_aws -check_linux -check_darwin -check_docker