Skip to content

Commit e41259e

Browse files
bio-borisBoris Sadkhin
authored and
Boris Sadkhin
committedJun 22, 2022
Initial Release
1 parent 69b4b2a commit e41259e

File tree

7 files changed

+129
-25
lines changed

7 files changed

+129
-25
lines changed
 

‎.github/workflows/manual-build.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Manual Build & Push
3+
on:
4+
workflow_dispatch:
5+
jobs:
6+
build-push:
7+
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
8+
with:
9+
name: '${{ github.event.repository.name }}-develop'
10+
tags: br-${{ github.ref_name }}
11+
secrets: inherit

‎.github/workflows/pr_build.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
name: Pull Request Build, Tag, & Push
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- main
8+
- master
9+
types:
10+
- opened
11+
- reopened
12+
- synchronize
13+
- closed
14+
jobs:
15+
build-develop-open:
16+
if: github.base_ref == 'develop' && github.event.pull_request.merged == false
17+
uses: kbase/.github/.github/workflows/reusable_build.yml@main
18+
secrets: inherit
19+
build-develop-merge:
20+
if: github.base_ref == 'develop' && github.event.pull_request.merged == true
21+
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
22+
with:
23+
name: '${{ github.event.repository.name }}-develop'
24+
tags: pr-${{ github.event.number }},latest
25+
secrets: inherit
26+
build-main-open:
27+
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == false
28+
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
29+
with:
30+
name: '${{ github.event.repository.name }}'
31+
tags: pr-${{ github.event.number }}
32+
secrets: inherit
33+
build-main-merge:
34+
if: (github.base_ref == 'main' || github.base_ref == 'master') && github.event.pull_request.merged == true
35+
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
36+
with:
37+
name: '${{ github.event.repository.name }}'
38+
tags: pr-${{ github.event.number }},latest-rc
39+
secrets: inherit
40+
trivy-scans:
41+
if: (github.base_ref == 'develop' || github.base_ref == 'main' || github.base_ref == 'master' ) && github.event.pull_request.merged == false
42+
uses: kbase/.github/.github/workflows/reusable_trivy-scans.yml@main
43+
secrets: inherit

‎.github/workflows/release-main.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Release - Build & Push Image
3+
on:
4+
release:
5+
branches:
6+
- main
7+
- master
8+
types: [ published ]
9+
jobs:
10+
check-source-branch:
11+
uses: kbase/.github/.github/workflows/reusable_validate-branch.yml@main
12+
with:
13+
build_branch: '${{ github.event.release.target_commitish }}'
14+
validate-release-tag:
15+
needs: check-source-branch
16+
uses: kbase/.github/.github/workflows/reusable_validate-release-tag.yml@main
17+
with:
18+
release_tag: '${{ github.event.release.tag_name }}'
19+
build-push:
20+
needs: validate-release-tag
21+
uses: kbase/.github/.github/workflows/reusable_build-push.yml@main
22+
with:
23+
name: '${{ github.event.repository.name }}'
24+
tags: '${{ github.event.release.tag_name }},latest'
25+
secrets: inherit

‎Dockerfile

+34-16
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,54 @@
11
FROM ubuntu:20.04
22

3+
# Note that these labels need to be manually updated with the actual contents of the image
34
LABEL maintainer="scanon@lbl.gov"
45
LABEL us.kbase.ubuntu="20.04"
5-
LABEL us.kbase.python="3.8.4"
6-
LABEL us.kbase.sdk="1.0.18"
6+
LABEL us.kbase.python="3.9.12"
7+
LABEL us.kbase.sdk="1.2.1"
8+
LABEL us.kbase.sdkcommit="8def489f648a7ff5657d33ed05f41c60f4766e1b"
79

10+
# Fix KBase Catalog Registration Issue
11+
ENV PIP_PROGRESS_BAR=off
12+
13+
# Install system dependencies
814
RUN \
915
apt-get -y update && \
16+
apt-get -y upgrade && \
1017
export DEBIAN_FRONTEND=noninteractive && \
1118
export TZ=Etc/UTC && \
12-
apt-get -y install gcc make curl git openjdk-8-jre
19+
apt-get -y install gcc make curl git openjdk-8-jre unzip htop
1320

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

25+
26+
# Install Conda version py39_4.12.0 and Python 3.9.12
27+
ENV CONDA_VERSION=py39_4.12.0
28+
ENV CONDA_INSTALL_DIR=/opt/conda/py39_4.12.0
29+
1830
RUN \
19-
V=py38_4.10.3 && \
20-
curl -o conda.sh -s https://repo.anaconda.com/miniconda/Miniconda3-${V}-Linux-x86_64.sh && \
21-
sh ./conda.sh -b -p /opt/conda3 && \
31+
echo "Installing to ${CONDA_INSTALL_DIR}" && \
32+
curl -o conda.sh -s https://repo.anaconda.com/miniconda/Miniconda3-${CONDA_VERSION}-Linux-x86_64.sh && \
33+
sh ./conda.sh -b -p ${CONDA_INSTALL_DIR} && \
2234
rm conda.sh
2335

24-
ENV PATH=/opt/conda3/bin:$PATH:/sdk/bin
36+
# Add in some legacy modules
2537

26-
# Install packages including mamba
27-
RUN \
28-
conda install -c conda-forge mamba
38+
ADD biokbase $CONDA_INSTALL_DIR/lib/biokbase
39+
ADD biokbase/user-env.sh /kb/deployment/user-env.sh
40+
ADD requirements.txt /tmp/requirements.txt
2941

30-
ADD ./requirements.txt /tmp/
31-
RUN \
32-
pip install -r /tmp/requirements.txt
42+
ENV PATH=$CONDA_INSTALL_DIR/bin:/sdk/bin:$PATH
43+
run env
3344

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

51+
#Install packages required for base image
52+
RUN \
53+
which pip && \
54+
pip install -r /tmp/requirements.txt

‎README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SDK Base Python Image
22

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

55

66
## Contents
@@ -9,7 +9,7 @@ This image just contains the basics.
99

1010
* Ubuntu 20.04 base image
1111
* Dependencies packages: gcc make curl git openjdk-8-jre
12-
* Installation of the kb-sdk tool (1.0.18)
13-
* Python 3.8 via Conda
12+
* Installation of the kb-sdk tool (1.2.1)
13+
* Python 3.9.13 via Conda
1414
* Mamba for Conda package installation
15-
* A select set of python modules
15+
* A select set of python modules in the requirements.txt

‎biokbase/user-env.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
3+
# In order to avoid `./scripts/entrypoint.sh: line 3: /kb/deployment/user-env.sh: No such file or directory`
4+
# This file is now here
5+
echo "user-env.sh is ignored"

‎requirements.txt

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
requests
2-
coverage
3-
nose
4-
sphinx
5-
jsonrpcbase
1+
requests==2.27.1
2+
coverage==6.3.3
3+
nose==1.3.7
4+
sphinx==4.5.0
5+
jsonrpcbase==0.2.0
6+
pytest==7.1.1
7+
pytest-cov==3.0.0

0 commit comments

Comments
 (0)
Please sign in to comment.