Skip to content

Commit

Permalink
Merge e0f8bde into ed781b0
Browse files Browse the repository at this point in the history
  • Loading branch information
sychan committed Oct 25, 2018
2 parents ed781b0 + e0f8bde commit fc4680a
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM kbase/sdkbase2:latest AS build


COPY . /tmp/catalog
RUN cd /tmp/catalog && make deploy-service deploy-server-control-scripts

FROM kbase/kb_python:latest
# These ARGs values are passed in via the docker build command
ARG BUILD_DATE
ARG VCS_REF
ARG BRANCH

ENV KB_DEPLOYMENT_CONFIG "/kb/deployment/conf/deploy.cfg"

COPY --from=build /kb/deployment/lib/biokbase /kb/deployment/lib/biokbase
COPY --from=build /kb/deployment/services /kb/deployment/services
COPY --from=build /tmp/catalog/deployment/conf /kb/deployment/conf

LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/kbase/catalog.git" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.schema-version="1.0.0-rc1" \
us.kbase.vcs-branch=$BRANCH \
maintainer="Steve Chan sychan@lbl.gov"


ENTRYPOINT [ "/kb/deployment/bin/dockerize" ]

# Here are some default params passed to dockerize. They would typically
# be overidden by docker-compose at startup
CMD [ "-template", "/kb/deployment/conf/.templates/deploy.cfg.templ:/kb/deployment/conf/deploy.cfg", \
"/kb/deployment/services/catalog/start_service" ]
48 changes: 48 additions & 0 deletions deployment/conf/.templates/deploy.cfg.templ
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[catalog]

# host where mongo lives, e.g. localhost:27017
mongodb-host = {{ default .Env.mongodb_host "localhost:27017" }}

# name of the workspace mongo database
mongodb-database = {{ default .Env.mongodb_database "catalog" }}

# the user name for an account with readWrite access to the database
mongodb-user = {{ default .Env.mongodb_user "" }}

# password for the account
mongodb-pwd = {{ default .Env.mongodb_pwd "" }}

# The KBase auth server url.
auth-service-url = {{ default .Env.auth_service_url "https://kbase.us/services/authorization/Sessions/Login" }}

# Path to docker socket/host
docker-base-url = {{ default .Env.docker_base_url "unix://var/run/docker.sock" }}
# for tcp: "tcp://host:port"
# Docker registry to use
docker-registry-host = {{ default .Env.docker_registry_host "dockerhub-ci.kbase.us" }}

# Users (kbase account username) that can review/approve/disable modules and releases.
# Multiple admin users can be specified as a comma delimited list
admin-users = {{ default .Env.admin_users "kkeller,scanon,sychan,dolson" }}

# Temporary working directory for checking out repos and doing stuff
temp-dir = {{ default .Env.temp_dir "" }}

# Configuration for server (uwsgi) variables
service-port = {{ default .Env.service_port "5000" }}
http-timeout = {{ default .Env.http_timeout "600" }}
processes = {{ default .Env.processes "20" }}
threads = {{ default .Env.threads "4" }}
cheaper = {{ default .Env.cheaper "4" }}

# Narrative Method Store configuration. Provide either a token or a uid/pwd.
# If both are provided, the token is used.
nms-url = {{ default .Env.nms_url "https://ci.kbase.us/services/narrative_method_store/rpc" }}
nms-admin-token ={{ default .Env.nms_admin_token "" }}

# File system path to mounted network drive used for reference data
ref-data-base = {{ default .Env.ref_data_base "/kb/data" }}

# KBase services end-point used for configuration generation in ref-data initialization
kbase-endpoint = {{ default .Env.kbase_endpoint "https://ci.kbase.us/services" }}

17 changes: 17 additions & 0 deletions hooks/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# $IMAGE_NAME var is injected into the build so the tag is correct.

echo "Build hook running"
echo "IMAGE_NAME = ${IMAGE_NAME}"
echo "DOCKER_REPO = ${DOCKER_REPO}"
echo "CACHE_TAG = ${CACHE_TAG}"
export BRANCH=${TRAVIS_BRANCH:-`git symbolic-ref --short HEAD`}

export DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
export COMMIT=${TRAVIS_COMMIT:-`git rev-parse --short HEAD`}
docker build --build-arg BUILD_DATE=$DATE \
--build-arg VCS_REF=$COMMIT \
--build-arg BRANCH=$BRANCH \
-t ${IMAGE_NAME} . && \
echo "Built and tagged ${IMAGE_NAME}"

0 comments on commit fc4680a

Please sign in to comment.