Skip to content

Latest commit

 

History

History
59 lines (49 loc) · 2.22 KB

README.md

File metadata and controls

59 lines (49 loc) · 2.22 KB

KAN Portal

(last edit: 4/24/2023)

KAN Portal is packaged as a Docker container. We provide a Makefile for building the container and pushing the container to a container registry.

0. Prerequisites

  • Docker

    NOTE: Some tools we use work better with access to docker commands without sudo. Use Docker Desktop version when possible. Otherwise, you need to add your user to docker group (see instructions). Please don't use rootless model, which isn't supported by some of the tools.

  • make and gcc
    sudo apt-get update && sudo apt-get upgrade -y
    sudo apt-get install make gcc -y
  • Helm (optional for building Helm chart)

1. Create environment variables

Maintain a .env file under the portal folder with the following environment variables:

  • Container registry:
    CONTAINER_REGISTRY_NAME="kanprod.azurecr.io" # replace with your own container registry name
  • Azure application insights:
    APPLICATIONINSIGHTS_INSTRUMENTATION_KEY="testinstkey"
    APPLICATIONINSIGHTS_INGESTION_ENDPOINT="https://testinsight.in.applicationinsights.azure.com/"
    APPLICATIONINSIGHTS_TENANT_ID="app-insight-tenant-id"
    APPLICATIONINSIGHTS_CLIENT_ID="app-insight-client-id"
    APPLICATIONINSIGHTS_CLIENT_SECRET="app-insight-client-secret"
  • Django secret:
    SECRET_KEY="django-secret-key"

NOTE: Django SECRET_KEY is a random string needed when starting django apps, which requires 50 characters in length with a minimum 5 unique characters.

2. Set version number

export MODULE_VERSION=<version>

The built container will be tagged as <CONTAINER_REGISTRY_NAME>/kanportal:<version>-<CPU architecture>, such as kanprod.azurecr.io/kanportal:0.41.46-amd64.

NOTE: The current Makefile builds for amd64 only.

3. Build KAN Portal container

Build webmodule image

    # under src/portal folder
    . .env # apply environment variables
    export WEBMODULE_PATH=./modules/webmodule
    make build

Push webmodule image

    make push