Skip to content

Commit

Permalink
Initial Release
Browse files Browse the repository at this point in the history
  • Loading branch information
bio-boris authored and Boris Sadkhin committed Jun 22, 2022
1 parent 69b4b2a commit e41259e
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 25 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Manual Build & Push
on:
workflow_dispatch:
jobs:
build-push:
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: br-${{ github.ref_name }}
secrets: inherit
43 changes: 43 additions & 0 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Pull Request Build, Tag, & Push
on:
pull_request:
branches:
- develop
- main
- master
types:
- opened
- reopened
- synchronize
- closed
jobs:
build-develop-open:
if: github.base_ref == 'develop' && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build.yml@main
secrets: inherit
build-develop-merge:
if: github.base_ref == 'develop' && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}-develop'
tags: pr-${{ github.event.number }},latest
secrets: inherit
build-main-open:
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }}
secrets: inherit
build-main-merge:
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == true
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: pr-${{ github.event.number }},latest-rc
secrets: inherit
trivy-scans:
if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
secrets: inherit
25 changes: 25 additions & 0 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Release - Build & Push Image
on:
release:
branches:
- main
- master
types: [ published ]
jobs:
check-source-branch:
uses: kbase/.github/.github/workflows/reusable_validate-branch.yml@main
with:
build_branch: '${{ github.event.release.target_commitish }}'
validate-release-tag:
needs: check-source-branch
uses: kbase/.github/.github/workflows/reusable_validate-release-tag.yml@main
with:
release_tag: '${{ github.event.release.tag_name }}'
build-push:
needs: validate-release-tag
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
with:
name: '${{ github.event.repository.name }}'
tags: '${{ github.event.release.tag_name }},latest'
secrets: inherit
50 changes: 34 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,54 @@
FROM ubuntu:20.04

# Note that these labels need to be manually updated with the actual contents of the image
LABEL maintainer="[email protected]"
LABEL us.kbase.ubuntu="20.04"
LABEL us.kbase.python="3.8.4"
LABEL us.kbase.sdk="1.0.18"
LABEL us.kbase.python="3.9.12"
LABEL us.kbase.sdk="1.2.1"
LABEL us.kbase.sdkcommit="8def489f648a7ff5657d33ed05f41c60f4766e1b"

# Fix KBase Catalog Registration Issue
ENV PIP_PROGRESS_BAR=off

# Install system dependencies
RUN \
apt-get -y update && \
apt-get -y upgrade && \
export DEBIAN_FRONTEND=noninteractive && \
export TZ=Etc/UTC && \
apt-get -y install gcc make curl git openjdk-8-jre
apt-get -y install gcc make curl git openjdk-8-jre unzip htop

# Copy in the SDK
COPY --from=kbase/kb-sdk:20180808 /src /sdk
COPY --from=kbase/kb-sdk:1.2.1 /src /sdk
RUN sed -i 's|/src|/sdk|g' /sdk/bin/*


# Install Conda version py39_4.12.0 and Python 3.9.12
ENV CONDA_VERSION=py39_4.12.0
ENV CONDA_INSTALL_DIR=/opt/conda/py39_4.12.0

RUN \
V=py38_4.10.3 && \
curl -o conda.sh -s https://repo.anaconda.com/miniconda/Miniconda3-${V}-Linux-x86_64.sh && \
sh ./conda.sh -b -p /opt/conda3 && \
echo "Installing to ${CONDA_INSTALL_DIR}" && \
curl -o conda.sh -s https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh && \
sh ./conda.sh -b -p ${CONDA_INSTALL_DIR} && \
rm conda.sh

ENV PATH=/opt/conda3/bin:$PATH:/sdk/bin
# Add in some legacy modules

# Install packages including mamba
RUN \
conda install -c conda-forge mamba
ADD biokbase $CONDA_INSTALL_DIR/lib/biokbase
ADD biokbase/user-env.sh /kb/deployment/user-env.sh
ADD requirements.txt /tmp/requirements.txt

ADD ./requirements.txt /tmp/
RUN \
pip install -r /tmp/requirements.txt
ENV PATH=$CONDA_INSTALL_DIR/bin:/sdk/bin:$PATH
run env

# Add in some legacy modules
ADD biokbase /opt/conda3/lib/python3.8/site-packages/biokbase
# Configure Conda and Install Mamba
RUN \
conda config --add channels conda-forge && \
conda config --set channel_priority strict && \
conda install -y mamba=0.15.3

#Install packages required for base image
RUN \
which pip && \
pip install -r /tmp/requirements.txt
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SDK Base Python Image

This is a very minimal base python image for building KBase SDK apps.
This is a very minimal base python image for building KBase SDK apps. It also contains a copy of the KBase SDK.


## Contents
Expand All @@ -9,7 +9,7 @@ This image just contains the basics.

* Ubuntu 20.04 base image
* Dependencies packages: gcc make curl git openjdk-8-jre
* Installation of the kb-sdk tool (1.0.18)
* Python 3.8 via Conda
* Installation of the kb-sdk tool (1.2.1)
* Python 3.9.13 via Conda
* Mamba for Conda package installation
* A select set of python modules
* A select set of python modules in the requirements.txt
5 changes: 5 additions & 0 deletions biokbase/user-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

# In order to avoid `./scripts/entrypoint.sh: line 3: /kb/deployment/user-env.sh: No such file or directory`
# This file is now here
echo "user-env.sh is ignored"
12 changes: 7 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
requests
coverage
nose
sphinx
jsonrpcbase
requests==2.27.1
coverage==6.3.3
nose==1.3.7
sphinx==4.5.0
jsonrpcbase==0.2.0
pytest==7.1.1
pytest-cov==3.0.0

0 comments on commit e41259e

Please sign in to comment.