diff --git a/.github/actions/deploy_gcloud/action.yml b/.github/actions/deploy_gcloud/action.yml index 2f0eab0..a7d7e0c 100644 --- a/.github/actions/deploy_gcloud/action.yml +++ b/.github/actions/deploy_gcloud/action.yml @@ -1,5 +1,5 @@ name: Deploy to Google Cloud -description: Deploys portal, rapid-router and aimmo to Google Cloud +description: Deploys portal and rapid-router to Google Cloud inputs: app-id: description: App ID @@ -76,10 +76,6 @@ inputs: react-app-kurono-badges-url: description: URL for Kurono badges service required: true - aimmo-branch: - description: Optional rapid-router branch to deploy - default: "" - required: false portal-branch: description: Optional portal branch to deploy default: "" @@ -125,34 +121,6 @@ runs: pip install -t lib django-anymail[amazon_ses] pip install -t lib google-auth==1.* - - # Install aimmo - if [[ $MODULE_NAME = "default" ]]; then - pip install -t lib --upgrade --no-deps aimmo - else - if [[ -z $AIMMO_BRANCH ]]; then - pip install -t lib --pre --upgrade --no-deps aimmo - else - REQUIREMENTS_ARGS+="--aimmo-branch ${AIMMO_BRANCH} " - - git clone --depth 1 --branch ${AIMMO_BRANCH} https://github.com/ocadotechnology/aimmo.git - - pushd aimmo - pip install wheel - ./aimmo_runner/build_worker_wheel.sh - popd - - pushd aimmo/game_frontend - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm - nvm install 12.20.2 - nvm use 12.20.2 - yarn --frozen-lockfile - NODE_ENV=production node djangoBundler.js - popd - pip install -t lib --pre --upgrade --no-deps ./aimmo - fi - fi # Install custom common package after everything else if deploying a specific portal branch to ensure the # changes from common come through @@ -166,26 +134,10 @@ runs: ./manage.py collectstatic --noinput --settings django_site.pipeline_settings env: MODULE_NAME: ${{ inputs.module-name }} - AIMMO_BRANCH: ${{ inputs.aimmo-branch }} PORTAL_BRANCH: ${{ inputs.portal-branch }} RAPID_ROUTER_BRANCH: ${{ inputs.rapid-router-branch }} shell: bash - - name: "Get cluster credentials" - run: | - gcloud components install gke-gcloud-auth-plugin - gcloud container clusters get-credentials "aimmo-$MODULE_NAME" --zone "$GKE_ZONE" - env: - MODULE_NAME: ${{ inputs.module-name }} - GKE_ZONE: ${{ inputs.gke-zone }} - shell: bash - - - name: "Deploy k8s" - run: python clusters_setup/deploy.py $MODULE_NAME - env: - MODULE_NAME: ${{ inputs.module-name }} - shell: bash - - name: "Deploy" run: | # Install Cloud SQL Proxy - Fixing to version 1.32.0 for now as upgrading to 1.33.0 causes an error when pinging the server later @@ -214,7 +166,6 @@ runs: exit 1 fi - envsubst django_site/kubeconfig.yaml envsubst app.yaml ./manage.py migrate --no-input diff --git a/.github/workflows/deploy_dev.yml b/.github/workflows/deploy_dev.yml index a89a6d4..3d93cc9 100644 --- a/.github/workflows/deploy_dev.yml +++ b/.github/workflows/deploy_dev.yml @@ -3,10 +3,6 @@ name: Deploy to Dev on: workflow_dispatch: inputs: - aimmo-branch: - description: "aimmo branch" - required: false - default: "" portal-branch: description: "portal branch" required: false @@ -83,7 +79,6 @@ jobs: redis-ip: ${{ secrets.REDIS_IP }} redis-port: ${{ secrets.REDIS_PORT }} react-app-kurono-badges-url: ${{ secrets.REACT_APP_KURONO_BADGES_URL }} - aimmo-branch: ${{ github.event.inputs.aimmo-branch }} portal-branch: ${{ github.event.inputs.portal-branch }} rapid-router-branch: ${{ github.event.inputs.rapid-router-branch }} @@ -92,7 +87,6 @@ jobs: run: ./notify_deployment.py env: DEPLOY_NOTIFY_URL: ${{ secrets.DEPLOY_NOTIFY_URL }} - AIMMO_BRANCH: ${{ github.event.inputs.aimmo-branch }} PORTAL_BRANCH: ${{ github.event.inputs.portal-branch }} RAPID_ROUTER_BRANCH: ${{ github.event.inputs.rapid-router-branch }} diff --git a/app.yaml.tmpl b/app.yaml.tmpl index 11bdddc..c9a3c9c 100644 --- a/app.yaml.tmpl +++ b/app.yaml.tmpl @@ -50,4 +50,3 @@ env_variables: AWS_ACCESS_KEY_ID: '${AWS_ACCESS_KEY_ID}' AWS_SECRET_ACCESS_KEY: '${AWS_SECRET_ACCESS_KEY}' REACT_APP_KURONO_BADGES_URL: '${REACT_APP_KURONO_BADGES_URL}' - KUBECONFIG: 'kubeconfig.yaml' diff --git a/django_site/apps.py b/django_site/apps.py index 509cd26..33a90db 100644 --- a/django_site/apps.py +++ b/django_site/apps.py @@ -1,34 +1,6 @@ import logging import os -import time -from threading import Thread - -import yaml -from kubernetes import config CURR_DIR = os.path.abspath(os.path.dirname(__file__)) logging.basicConfig(level=logging.DEBUG) - - -def setup_gke(): - filename = os.path.join(CURR_DIR, "kubeconfig.yaml") - config_dict = yaml.safe_load(open(filename, "r").read()) - config_reload_interval = 15 * 60 # 15 minutes - - def load_kube_config_periodically(interval): - while True: - try: - logging.info("Loading kube config") - config.load_kube_config_from_dict(config_dict) - except: - logging.exception("Exception when calling load_kube_config_from_dict") - time.sleep(interval) - - # Start a thread that loads kube config periodically - thread = Thread( - target=load_kube_config_periodically, - args=(config_reload_interval,), - daemon=True, - ) - thread.start() diff --git a/django_site/kubeconfig.yaml.tmpl b/django_site/kubeconfig.yaml.tmpl deleted file mode 100644 index 676d24b..0000000 --- a/django_site/kubeconfig.yaml.tmpl +++ /dev/null @@ -1,32 +0,0 @@ -apiVersion: v1 -kind: Config -current-context: aimmo-${MODULE_NAME} -contexts: - [ - { - name: aimmo-dev, - context: { cluster: aimmo-dev, user: django-app-engine }, - }, - { - name: aimmo-staging, - context: { cluster: aimmo-staging, user: django-app-engine }, - }, - { - name: aimmo-default, - context: { cluster: aimmo-default, user: django-app-engine }, - }, - ] -users: [{ name: django-app-engine, user: { auth-provider: { name: gcp } } }] -clusters: - - name: aimmo-dev - cluster: - certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVMVENDQXBXZ0F3SUJBZ0lSQUpxV3Y3a0VkWkpCUjdobytsSVZiMHN3RFFZSktvWklodmNOQVFFTEJRQXcKTHpFdE1Dc0dBMVVFQXhNa1l6VTJZMlZpWXpRdE0ySmhOUzAwTlRjNExXRmpN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ZFIyM3pSSTY5K24wMHJoc081Qko1dE51ZFBJU244ClQ5MVdscThYVVJTRXRmZG9JU095MjdLcUFMelphSkQzR1VraTVZT21NOUs0YXg3ZnZabVNMcWpnVGtmMDR2RlYKZWdDWGxINUJKS01LL0MrOEVMcXlUcVRLSVJxVTA0cjQzMmhsZEk3ZFBWVThEeEY2VWxUSDVaOVQyaXE2SElrZAp2cW1TNEVxbzkraVFOSmFsZ0FPUjR6elgwOXFFMksxbHVwd0ppaTY1d1RJNXVoUHBHR0VHaGY5OWIwMVJCRkZvCmFOZ1JqeXNwc0tOUHd4d3FXUnUyL0VBQXJreGJzaG1RQXk3SHk2RFE3d2pxR2Q2UGZUNEZzeVlxQUNYRTcxRnUKR3ExbEhTNHNCcGg0aDZYdm42a3lwUEh4cml6a1liYklaM21HZzBYcndWbEF5TmZCQmZLSWRQemcwc2JpdDRqZgpqRXlaSzRmYXNPQjcvbEpnSmhRMVN5elA2T1ZraTZURnFJeWFaekpKTG5JMm16UFpjeURTT3RxTmZwT1Z4R1VvCjBwZFB3QnA0b09KMkthUVFFVjl4b3laVWkzYUU4ZU5JL21XZ0dQdVZXbVUyMGlNRHkwY0tvY2NudDZENFhYeVMKcjJLTTh3K1FXUWlFc1h1NGM5Q0VTUTg9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K - server: https://34.77.183.161 - - name: aimmo-default - cluster: - certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVMRENDQXBTZ0F3SUJBZ0lRTUxBaXBIS1JMVHZkYm5XblNSaWZ1ekFOQmdrcWhraUc5dzBCQVFzRkFEQXYKTVMwd0t3WURWUVFERXlSalpqQTROR0l4TXkxbE5qZGxMVFJoWkdJdE9XTXpaUzFsWW1aaFptRTBOMk0wWkRndwpJQmNOTWpNd05qSTVNVEl4TURNeldoZ1BNakExTXpBMk1qRXhNekV3TXpOYU1DOHhMVEFyQmdOVkJBTVRKR05tCk1EZzBZakV6TFdVMk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dUcFVBcjZFZDBhQnZmWXI1cG5QV0xoNlFDcDc5SXloaldOQkNuVUUreXBHWXdxOWYwdzcKbmVNZm9IK0xuQU5BNXVyb1B0cU5JNm9iTitBd0NMaHh5K2hidlpXY251ZUZCZXUwY2RpOVN3MER1elhCZGpVRQp3QWI2cW1LdHRoQktCd1ZSWEh3WTY1Vk1DVUIrUXlnWVhOUi9jRFAycWJLZlNCWFZld1llYy9VN2VBUkZvSUNiCm81VEpzY1RjNjJReGdHNXcwcTR2aWEzdFNNdG92Z054Y2xQam5YdWU5T3JVRytNOWdZKzc2UVR2M1NxbjNwYzMKUTVDNUlJK3laTHlZbmhhcUZxQ3UzcHhFcktQRG1aSDJpKzFia0paS0hkbGZoc1RzRTR2WEgxVEpKZnc3K2ErbgpCc1M2aTRrbFZBZy83eExwQXBQUUZNMkVZcVVJelgyOEVBd0hWUUVWaVlmY0ZiZnZEVVlkZmZ5OFpRSnI4ZVpkCjRRZlFyT3dCOURqYWQ0THVja3NCNS9ubkdoRVlQMkVQV21obVRXRHZYazhHRk80cCt5NGJIRW5SdlpzVUxyNEkKUXk5bVJrMGhPcU0vT2o4OEYwQTQ3Zz09Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K - server: https://35.187.116.108 diff --git a/django_site/pipeline_settings.py b/django_site/pipeline_settings.py index a2733ef..c5e507c 100644 --- a/django_site/pipeline_settings.py +++ b/django_site/pipeline_settings.py @@ -22,7 +22,6 @@ INSTALLED_APPS = ( "anymail", "deploy", - "aimmo", "game", "pipeline", "portal", diff --git a/django_site/settings.py b/django_site/settings.py index 22f0c39..1b0d0f5 100644 --- a/django_site/settings.py +++ b/django_site/settings.py @@ -62,7 +62,6 @@ INSTALLED_APPS = ( "anymail", "deploy", - "aimmo", "game", "pipeline", "portal", @@ -104,7 +103,6 @@ "preventconcurrentlogins.middleware.PreventConcurrentLoginsMiddleware", "csp.middleware.CSPMiddleware", "deploy.middleware.screentime_warning.ScreentimeWarningMiddleware", - "aimmo.middleware.game_limit_exceeded.GameLimitExceededMiddleware", ] AUTHENTICATION_BACKENDS = [ @@ -219,16 +217,6 @@ CSRF_COOKIE_SECURE = True CSRF_USE_SESSIONS = False - AIMMO_DJANGO_BASE_URL = f"https://{os.getenv('GAE_SERVICE')}-dot-decent-digit-629.appspot.com" - - AIMMO_GAME_SERVER_URL_FUNCTION = lambda game: ( - f"{os.getenv('GAE_SERVICE')}-aimmo.codeforlife.education", - f"/game-{game}/socket.io", - ) - - AIMMO_GAME_SERVER_PORT_FUNCTION = lambda game: 0 - AIMMO_GAME_SERVER_SSL_FLAG = True - EMAIL_ADDRESS = "no-reply@codeforlife.education" LOCALE_PATHS = ("conf/locale",) @@ -301,8 +289,6 @@ def domain(): "https://crowdin.com/", "https://o2.mouseflow.com/", "https://stats.g.doubleclick.net/", - f"wss://{MODULE_NAME}-aimmo.codeforlife.education/", - f"https://{MODULE_NAME}-aimmo.codeforlife.education/", ) CSP_FONT_SRC = ( "'self'", diff --git a/django_site/views.py b/django_site/views.py index 0f14dae..1121b62 100644 --- a/django_site/views.py +++ b/django_site/views.py @@ -1,6 +1,5 @@ from django.http import JsonResponse -import aimmo import game import portal @@ -8,7 +7,6 @@ def versions(_request): """Return json containing the installed versions of the main packages.""" return JsonResponse({ - 'aimmo': aimmo.__version__, 'codeforlife-portal': portal.__version__, 'rapid-router': game.__version__ }) diff --git a/django_site/wsgi.py b/django_site/wsgi.py index 8776c90..a08714a 100644 --- a/django_site/wsgi.py +++ b/django_site/wsgi.py @@ -11,7 +11,6 @@ import logging import google.cloud.logging from google.auth.exceptions import DefaultCredentialsError -from .apps import setup_gke logging.basicConfig(level=logging.DEBUG) @@ -25,8 +24,6 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_site.settings") -setup_gke() - from lib.django.core.wsgi import get_wsgi_application application = get_wsgi_application() diff --git a/generate_requirements.py b/generate_requirements.py index 04c8ea6..95499ef 100644 --- a/generate_requirements.py +++ b/generate_requirements.py @@ -1,7 +1,6 @@ import argparse -# Versions will be fetched from the init of each package (portal, aimmo, game) after they are installed in lib - this happens in the "Build" step. -from lib.aimmo import __version__ as aimmo_version +# Versions will be fetched from the init of each package (portal, game) after they are installed in lib - this happens in the "Build" step. from lib.game import __version__ as rapid_router_version from lib.portal import __version__ as portal_version @@ -9,7 +8,6 @@ parser = argparse.ArgumentParser() parser.add_argument("--portal-branch") parser.add_argument("--rapid-router-branch") -parser.add_argument("--aimmo-branch") args = parser.parse_args() if args.portal_branch: @@ -24,17 +22,11 @@ else: rapid_router_requirement = f"rapid-router=={rapid_router_version}" -if args.aimmo_branch: - aimmo_requirement = "./aimmo" -else: - aimmo_requirement = f"aimmo=={aimmo_version}" - requirements = "\n".join( [ rapid_router_requirement, portal_requirement, common_requirement, - aimmo_requirement, "requests-toolbelt==0.9.*", "mysqlclient==2.1.*", "redis==3.3.*", diff --git a/manage.py b/manage.py index 5c9d8ef..62aa115 100755 --- a/manage.py +++ b/manage.py @@ -9,10 +9,4 @@ from django.core.management import execute_from_command_line - # Need to setup GKE if running migrations - if sys.argv[1] == "migrate": - import kubernetes - - kubernetes.config.load_kube_config("/home/runner/.kube/config") - execute_from_command_line(sys.argv) diff --git a/notify_deployment.py b/notify_deployment.py index 1eb7715..109dbe9 100755 --- a/notify_deployment.py +++ b/notify_deployment.py @@ -10,7 +10,6 @@ logging.basicConfig() MODULE_NAME = os.environ.get("MODULE_NAME") -AIMMO_BRANCH = os.environ.get("AIMMO_BRANCH") PORTAL_BRANCH = os.environ.get("PORTAL_BRANCH") RAPID_ROUTER_BRANCH = os.environ.get("RAPID_ROUTER_BRANCH") @@ -33,8 +32,6 @@ except: logging.exception("Error occurred while getting versions") - if AIMMO_BRANCH: - versions["aimmo"] = AIMMO_BRANCH if PORTAL_BRANCH: versions["codeforlife-portal"] = PORTAL_BRANCH if RAPID_ROUTER_BRANCH: @@ -43,7 +40,6 @@ message += ( f"completed successfully :tada:\n" f"\n" - f"aimmo: `{versions['aimmo']}`\n" f"codeforlife-portal: `{versions['codeforlife-portal']}`\n" f"rapid-router: `{versions['rapid-router']}`" )