Skip to content

Commit

Permalink
Tar cloud YAMLs in cloud build release
Browse files Browse the repository at this point in the history
Summary:
We want to build a tar of the public cloud YAMLs + a list of the image tags to:
- Make it easier to deploy cloud without requiring kustomize
- Make it easier to deploy cloud in an air-gapped environment

Test Plan: Run the jenkins job, check the generated files: https://storage.googleapis.com/pixie-dev-public/cloud/latest/pixie_cloud.tar.gz

Reviewers: vihang

Reviewed By: vihang

Signed-off-by: Michelle Nguyen <michellenguyen@pixielabs.ai>

Differential Revision: https://phab.corp.pixielabs.ai/D11792

GitOrigin-RevId: 428c924
  • Loading branch information
aimichelle authored and copybaranaut committed Jul 12, 2022
1 parent b6ca41e commit 7438040
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ci/cloud_build_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,27 @@ if [[ "$PUBLIC" == "true" ]]; then
//src/cloud/plugin/load_db:push_plugin_db_updater_image
bazel run --stamp -c opt --action_env=GOOGLE_APPLICATION_CREDENTIALS --define BUNDLE_VERSION="latest" \
//src/cloud/plugin/load_db:push_plugin_db_updater_image

# Write YAMLs + image paths to a tar file to support easy deployment.
mkdir -p "${repo_path}/pixie_cloud"
mkdir -p "${repo_path}/pixie_cloud/yamls"
image_list_file="${repo_path}/pixie_cloud/cloud_image_list.txt"

kustomize build "k8s/cloud_deps/public/" > "${repo_path}/pixie_cloud/yamls/cloud_deps.yaml"
echo "---" >> "${repo_path}/pixie_cloud/yamls/cloud_deps.yaml"
kustomize build "k8s/cloud_deps/base/elastic/operator" >> "${repo_path}/pixie_cloud/yamls/cloud_deps.yaml"
kustomize build "k8s/cloud/public/" > "${repo_path}/pixie_cloud/yamls/cloud.yaml"

#shellcheck disable=SC2002
cat "${repo_path}/pixie_cloud/yamls/cloud_deps.yaml" | yq e '.. | .image? | select(.)' -o=json - | jq 'strings' | sort | uniq > "${image_list_file}"
#shellcheck disable=SC2002
cat "${repo_path}/pixie_cloud/yamls/cloud.yaml" | yq e '.. | .image? | select(.)' -o=json - | jq 'strings' | sort | uniq >> "${image_list_file}"

cd "${repo_path}"
tar -czvf "${repo_path}/pixie_cloud.tar.gz" "pixie_cloud"
gsutil cp "${repo_path}/pixie_cloud.tar.gz" "gs://pixie-dev-public/cloud/${image_tag}/pixie_cloud.tar.gz"
gsutil cp "${repo_path}/pixie_cloud.tar.gz" "gs://pixie-dev-public/cloud/latest/pixie_cloud.tar.gz"

exit 0
fi

Expand Down

0 comments on commit 7438040

Please sign in to comment.