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

better default bucket name, less resource request #2989

Merged
merged 3 commits into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 0 additions & 2 deletions manifests/gcp_marketplace/deployer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
RUN mv /bin/deploy.sh /bin/core_deploy.sh
RUN mv /bin/deploy_with_tests.sh /bin/core_deploy_with_tests.sh

# RUN awk '{sub(/clean_iam_resources.sh/,"clean_action.sh\n\nclean_iam_resources.sh")}1' /bin/core_deploy_with_tests.sh > /bin/new_deploy_with_tests.sh

ADD deployer/init_action.sh /bin/init_action.sh
RUN chmod 755 /bin/init_action.sh

Expand Down
13 changes: 6 additions & 7 deletions manifests/gcp_marketplace/deployer/init_action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
# limitations under the License.

function set_bucket_and_configmap() {
# Helper function to deploy bucket with a unique name. The unique name is ${BASE_NAME} + random
# unique string. Also detect the current GCP project ID and populate the properties into a
# Helper function to deploy bucket with a unique name.
# Also detect the current GCP project ID and populate the properties into a
# config map.
#
# Usage:
# set_bucket_and_configmap BASE_NAME NUM_RETRIES
BASE_NAME=$1
NUM_RETRIES=$2
# set_bucket_and_configmap NUM_RETRIES
NUM_RETRIES=$1
CONFIG_NAME="gcp-default-config"

# Detect GCP project
Expand All @@ -37,7 +36,7 @@ function set_bucket_and_configmap() {
for i in $(seq 1 ${NUM_RETRIES})
do
bucket_is_set=true
bucket_name="${BASE_NAME}-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 10 | head -n 1)"
bucket_name="hostedkfp-default-$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 10 | head -n 1)"
gsutil mb -p ${GCP_PROJECT_ID} "gs://${bucket_name}/" || bucket_is_set=false
if [ "$bucket_is_set" = true ]; then
break
Expand Down Expand Up @@ -69,6 +68,6 @@ NAMESPACE="$(/bin/print_config.py \
export NAME
export NAMESPACE

set_bucket_and_configmap "${NAME}-default" 10
set_bucket_and_configmap 10

echo "init_action done"
4 changes: 2 additions & 2 deletions manifests/gcp_marketplace/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ x-google-marketplace:
resources:
- replicas: 3
requests:
cpu: 2
memory: 4Gi
cpu: 1
memory: 2Gi
affinity:
simpleNodeAffinity:
type: REQUIRE_ONE_NODE_PER_REPLICA
Expand Down