Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Building

Gaurav Vaidya edited this page Sep 6, 2022 · 9 revisions

Building

The CAM-KP-API project is written in Scala. The build tool used to execute numerous development tasks is the Scala Build Tool (SBT).

Compiling

cam-kp-api$ sbt compile
cam-kp-api$ sbt Test/compile
cam-kp-api$ sbt IntegrationTest/compile

Deploying to a local Docker container

cam-kp-api$ sbt docker:stage docker:publishLocal
cam-kp-api$ CAM_KP_LOG_LEVEL=debug sbt docker:stage docker:publishLocal
cam-kp-api$ sbt test
cam-kp-api$ sbt IntegrationTest/test

Running from a local Docker container

cam-kp-api$ docker run -p 8080:8080 -it renciorg/cam-kp-api:0.1

Note that the version used in these examples may not reflect the latest build version.

Deployment to Kubernetes

Before deploying, the version number of cam-kp-api needs to be updated in:

  1. build.sbt
  2. application.conf

The following will build a Docker image with the specified version/tag & push it to hub.docker.com.

sbt 'set version := "0.2-trapi-1.3"' docker:stage docker:publish

The Helm Chart templates are located here: https://github.com/helxplatform/translator-devops/tree/develop/helm/cam-kp-api

To deploy to the 'translator-dev' namespace on the RENCI Sterling Kubernetes cluster:

KUBECONFIG=/home/jdr0887/.kube/kubeconfig-sterling-jdr0887-jdr0887 helm upgrade --install --debug -n translator-dev -f /home/jdr0887/cam-kp-api-dev-values.yaml cam-kp-api-dev helm/cam-kp-api/

If the cam-kp-api-dev Pod already exists (meaning you already ran the above command) & you want to deploy a new version straight from Docker, just delete the Pod & Kubernetes will grab the configured version from Docker Hub.

Backend triplestore deployment

The backend triplestore is generated by https://github.com/ncats-tangerine/cam-pipeline and is accessible at https://cam-kp-sparql[-dev].apps.renci.org/sparql (but note that the development version is only accessible within the RENCI VPN).