diff --git a/Makefile b/Makefile index dd30ac24a..18f5a156d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: build clean clean-gke fixes gke help pip-compile pip-install-local stop test up +.PHONY: build clean fixes help pip-compile pip-install-local stop test up help: @@ -11,8 +11,6 @@ help: @echo " pip-install-local Install pip project requirements to your local environment" @echo " test Runs pytest" @echo " up Runs the whole stack, served under http://localhost:8080/" - @echo " gke Create a sandbox gke cluster for testing" - @echo " clean-gke Delete the sandbox gke cluster" @echo " stop Stops the docker containers" build: @@ -48,11 +46,5 @@ up: docker-compose exec airflow-webserver airflow variables import dev_variables.json docker-compose exec airflow-webserver airflow connections import dev_connections.json -gke: - bin/start_gke - -clean-gke: - bin/stop_gke - test: python -m pytest tests/ diff --git a/bin/add_gcp_creds b/bin/add_gcp_creds deleted file mode 100755 index 652137bbc..000000000 --- a/bin/add_gcp_creds +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash - -set -eou pipefail - -keyfile_path=${1?"Must specify keyfile path"} - -connection=${2:-"google_cloud_airflow_gke"} - -# Wait for full display until after checks -set -x - -function format_gcp() { -KEYFILE="$1" python3 - </dev/null 2>&1; then - echo "cluster $CLUSTERNAME exists" -else - echo "cluster $CLUSTERNAME doesn't exist. creating..." - gcloud container clusters create $CLUSTERNAME \ - --enable-stackdriver-kubernetes \ - -m n1-standard-4 \ - --release-channel="stable" \ - --enable-master-authorized-networks \ - --master-authorized-networks="$MY_IP/32" \ - --region us-west1 \ - --num-nodes=1 \ - --scopes="cloud-platform" \ - --service-account="data-gke-sandbox-runner@moz-fx-data-gke-sandbox.iam.gserviceaccount.com" \ - --project moz-fx-data-gke-sandbox - -fi - -echo "fetching secret..." -JSON_CREDS=$(gcloud secrets versions access latest --secret="gke-sandbox-creds" --project moz-fx-data-gke-sandbox) - -# Upload secret to local wtmo -GCP_CONN_ID="google_cloud_gke_sandbox" - -CONTAINER_ID=$(docker ps --filter name=web -q) -if [ -z "$CONTAINER_ID" ]; then - echo "ERROR: Airflow container is likely not running (or docker). Run 'make up' to start airflow containers" -else - echo "Web container id is $CONTAINER_ID. Adding gcp connection..." - docker exec $CONTAINER_ID airflow connections delete $GCP_CONN_ID - - docker exec $CONTAINER_ID airflow connections add $GCP_CONN_ID \ - --conn-type google_cloud_platform \ - --conn-extra "$JSON_CREDS" -fi - -echo "visit https://mozilla-hub.atlassian.net/wiki/spaces/SRE/pages/27922811/WTMO+Developer+Guide for more info" diff --git a/bin/stop_gke b/bin/stop_gke deleted file mode 100755 index 602b8a3ae..000000000 --- a/bin/stop_gke +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -# This is to be used by the Makefile for a stop gke target. - -set -eo pipefail - -USERNAME=$(gcloud config get-value account | awk -F"@" '{print $1}') -CLUSTERNAME=$USERNAME-gke-sandbox - -if gcloud container clusters describe $CLUSTERNAME --region us-west1 --project moz-fx-data-gke-sandbox >/dev/null 2>&1; then - gcloud container clusters delete $CLUSTERNAME --region us-west1 --quiet --project moz-fx-data-gke-sandbox -else - echo "cluster $CLUSTERNAME does not exist" -fi