Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 5.49 KB

SETUP.md

File metadata and controls

62 lines (41 loc) · 5.49 KB

Step-by-Step Development Environment Setup Instructions

  1. Install the server dependencies as declared in the official guide.

    If the DNS lookup fails, try changing the DNS Variable to your local IP.
  2. Install Requirements as in Build Guide.

  3. Create a GitLab-Repo or a different container registry.

    The "build without remote registry" is not working since deploy_platform.sh does not support an empty CONTAINER_REGISTRY_URL.
  4. Set the registry URL as default_registry just as described in the Build Guide.

  5. Modify the Container and Helm Chart for Development (e.g. comment the production part of the Dockerfile, uncomment the development part and set the dev_files variable to your local src path for Landingpage as declared in the Readme).

  6. Run the start_build.py Script.

    Add parameters -u and -p with your GitLab credentials to let the build run in the background (takes around 1h). Rebuilding already existing containers on the registry, the duration is significantly decreased.
  7. Deploy as in Deployment Guide using the generated build/deploy_platform.sh.

    Since this command is often used to start and stop the cluster, it is recommended to use the following commands:
    - Start the cluster: printf "<local_url>\n" | bash <path_to_kaapana_folder>/build/kaapana-admin-chart/deploy_platform.sh where <local_url> is the URL with which to reach the website.
    - Stop the cluster: printf "<delete_permanent_volumes>\n" | bash <path_to_kaapana_folder>/build/kaapana-admin-chart/deploy_platform.sh —no-hooks where <delete_permanent_volumes> is either yes or no.
  8. Watch cluster and pod logs using:

    • Cluster:

      kubectl get pods -A -w -o wide

    • Pod:

      while :; do clear; kubectl logs -n services deploy/<pod_name>; sleep 2; done

      where <pod_name> can be found in the kubectl get pods -A -w -o wide output (without the added random characters e.g. "landingpage")

    Depending on your hardware, fully starting all pods can take 30 minutes. In some cases (like Landingpage) a host that only allows a small number of concurrently opened files can cause the pod to crash repeatedly before starting successfully.

Update a single pod (using the example pod: Landingpage)

  • After changes to a local container, build the local container and push it to the registry e.g:

    cd <path_to_kaapana_folder>/services/utils/base-landing-page && docker build -t local-only/base-landing-page:latest -f Dockerfile . && cd <path_to_kaapana_folder>/services/base/landing-page-kaapana/docker && docker build -t <registry_url>/landing-page-kaapana:<tag> . && docker push <registry_url>/landing-page-kaapana:<tag>

    where <tag> is the tag of the current container on the registry which is to be updated.

  • Force the pod to be recreated using the newly pushed container by changing its scaling:

    1. Decrease the replicas of the pod to 0:

      kubectl scale deployment -n <namespace> <pod_name> --replicas=0

      where <namespace> can be found as the first column in the kubectl get pods -A -w -o wide output.

    2. Increase the replicas of the pod to 1:

      kubectl scale deployment -n <namespace> <pod_name> --replicas=1