Skip to content

Commit

Permalink
merge gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
dthoward96 committed Nov 21, 2024
2 parents a814769 + db4b1bc commit 6d42208
Show file tree
Hide file tree
Showing 13 changed files with 210 additions and 139 deletions.
28 changes: 27 additions & 1 deletion .dockerignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
/shiny/*
/vignettes/*
/docs/*

# ignore file extensions
*.DS_Store
*.Rmd
*.html
*.md
*.Rhistory
*.gitignore
*.Rbuildignore
*.Rproj
DESCRIPTION

# ignore folders
**.git
**.github
**.Rproj.user
*docs
*vignettes
*man
*inst
*pkgdown

# ignore specific files
docker-compose.yml
docker-compose-*.yml
_pkgdown.yml
NAMESPACE
194 changes: 92 additions & 102 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,102 +1,92 @@
# Create an argument to pull a particular version of micromamba image
ARG micromamba_version
ARG micromamba_version=${micromamba_version:-1.5.3}

############# base image ##################
FROM --platform=$BUILDPLATFORM ubuntu:focal as base

# local apt mirror support
# start every stage with updated apt sources
ARG APT_MIRROR_NAME=
RUN if [ -n "$APT_MIRROR_NAME" ]; then sed -i.bak -E '/security/! s^https?://.+?/(debian|ubuntu)^http://'"$APT_MIRROR_NAME"'/\1^' /etc/apt/sources.list && grep '^deb' /etc/apt/sources.list; fi
RUN apt-get update --allow-releaseinfo-change --fix-missing

############# micromamba image ##################

FROM --platform=$BUILDPLATFORM mambaorg/micromamba:${micromamba_version} as micromamba
RUN echo "Getting micromamba image"

############# Build Stage: Final ##################

# Build the final image
FROM base as final

# if image defaults to a non-root user, then we may want to make the
# next 3 ARG commands match the values in our image.
ENV MAMBA_USER=$MAMBA_USER
ENV MAMBA_USER_ID=$MAMBA_USER_ID
ENV MAMBA_USER_GID=$MAMBA_USER_GID
ENV MAMBA_ROOT_PREFIX="/opt/conda"
ENV MAMBA_EXE="/bin/micromamba"

COPY --from=micromamba "$MAMBA_EXE" "$MAMBA_EXE"
COPY --from=micromamba /usr/local/bin/_activate_current_env.sh /usr/local/bin/_activate_current_env.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_shell.sh /usr/local/bin/_dockerfile_shell.sh
COPY --from=micromamba /usr/local/bin/_entrypoint.sh /usr/local/bin/_entrypoint.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_initialize_user_accounts.sh /usr/local/bin/_dockerfile_initialize_user_accounts.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_setup_root_prefix.sh /usr/local/bin/_dockerfile_setup_root_prefix.sh

# Install system dependencies
ARG DEBIAN_FRONTEND=noninteractive

# Install system libraries of general use
RUN apt-get update --allow-releaseinfo-change --fix-missing \
&& apt-get install --no-install-recommends -y \
dos2unix \
ca-certificates \
&& apt clean autoclean \
&& apt autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/

# Create working directory
ENV WORKDIR=/data

# Set up volume directory
VOLUME ${WORKDIR}

# Set up working directory
WORKDIR ${WORKDIR}

# Allow permission to read and write to working directory
RUN chmod -R a+rwx ${WORKDIR}

# Create a program variable
ENV PROJECT_DIR=/seqsender

# Set up a volume directory
VOLUME ${PROJECT_DIR}

# Copy all files to project directory
COPY . ${PROJECT_DIR}

############ Set-up micromamba environment ##################

# Copy requirement files to program directory
COPY env.yaml "${PROJECT_DIR}/env.yaml"

# Set up environments
RUN micromamba install --yes --name base -f "${PROJECT_DIR}/env.yaml" \
&& micromamba clean --all --yes

############# Launch PROGRAM ##################

# Copy bash script to run PROGRAM to docker image
COPY seqsender-kickoff "${PROJECT_DIR}/seqsender-kickoff"

# Convert bash script from Windows style line endings to Unix-like control characters
RUN dos2unix "${PROJECT_DIR}/seqsender-kickoff"

# Allow permission to excute the bash script
RUN chmod a+x "${PROJECT_DIR}/seqsender-kickoff"

# Allow permission to read and write to program directory
RUN chmod a+rwx ${PROJECT_DIR}

# Export bash script to path
ENV PATH="$PATH:${PROJECT_DIR}"

# Activate conda environment
ENV PATH="$PATH:${MAMBA_ROOT_PREFIX}/bin"

# Execute the pipeline
ENTRYPOINT ["tail", "-f", "/dev/null"]
# Create an argument to pull a particular version of micromamba image
ARG micromamba_version
ARG micromamba_version=${micromamba_version:-1.5.3}

############# micromamba image ##################

FROM mambaorg/micromamba:${micromamba_version} as micromamba
RUN echo "Getting micromamba image"

############# base image ##################

FROM ubuntu:focal as base

# if image defaults to a non-root user, then we may want to make the
# next 3 ARG commands match the values in our image.
ENV MAMBA_USER=$MAMBA_USER
ENV MAMBA_USER_ID=$MAMBA_USER_ID
ENV MAMBA_USER_GID=$MAMBA_USER_GID
ENV MAMBA_ROOT_PREFIX="/opt/conda"
ENV MAMBA_EXE="/bin/micromamba"

COPY --from=micromamba "$MAMBA_EXE" "$MAMBA_EXE"
COPY --from=micromamba /usr/local/bin/_activate_current_env.sh /usr/local/bin/_activate_current_env.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_shell.sh /usr/local/bin/_dockerfile_shell.sh
COPY --from=micromamba /usr/local/bin/_entrypoint.sh /usr/local/bin/_entrypoint.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_initialize_user_accounts.sh /usr/local/bin/_dockerfile_initialize_user_accounts.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_setup_root_prefix.sh /usr/local/bin/_dockerfile_setup_root_prefix.sh

# Install system dependencies
ARG DEBIAN_FRONTEND=noninteractive

# local apt mirror support
# start every stage with updated apt sources
ARG APT_MIRROR_NAME=
RUN if [ -n "$APT_MIRROR_NAME" ]; then sed -i.bak -E '/security/! s^https?://.+?/(debian|ubuntu)^http://'"$APT_MIRROR_NAME"'/\1^' /etc/apt/sources.list && grep '^deb' /etc/apt/sources.list; fi
RUN apt-get update --allow-releaseinfo-change --fix-missing \
&& apt-get install --no-install-recommends -y \
dos2unix \
ca-certificates \
&& apt clean autoclean \
&& apt autoremove --yes \
&& rm -rf /var/lib/{apt,dpkg,cache,log}/

# Create working directory
ENV WORKDIR=/data

# Set up volume directory
VOLUME ${WORKDIR}

# Set up working directory
WORKDIR ${WORKDIR}

# Allow permission to read and write to working directory
RUN chmod -R a+rwx ${WORKDIR}

# Create a program variable
ENV PROJECT_DIR=/seqsender

# Set up a volume directory
VOLUME ${PROJECT_DIR}

# Copy all files to project directory
COPY . ${PROJECT_DIR}

############ Set-up micromamba environment ##################

# Copy requirement files to program directory
COPY env.yaml "${PROJECT_DIR}/env.yaml"

# Set up environments
RUN micromamba install --yes --name base -f "${PROJECT_DIR}/env.yaml" \
&& micromamba clean --all --yes

############# Launch PROGRAM ##################

# Copy bash script to run PROGRAM to docker image
COPY seqsender-kickoff "${PROJECT_DIR}/seqsender-kickoff"

# Convert bash script from Windows style line endings to Unix-like control characters
RUN dos2unix "${PROJECT_DIR}/seqsender-kickoff"

# Allow permission to excute the bash script
RUN chmod a+x "${PROJECT_DIR}/seqsender-kickoff"

# Allow permission to read and write to program directory
RUN chmod a+rwx ${PROJECT_DIR}

# Export bash script to path
ENV PATH="$PATH:${PROJECT_DIR}"

# Activate conda environment
ENV PATH="$PATH:${MAMBA_ROOT_PREFIX}/bin"
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ github_pages_url <- description$GITHUB_PAGES

<p style="font-size: 16px;"><em>Public Database Submission Pipeline</em></p>

**Beta Version**: v1.2.3. This pipeline is currently in Beta testing, and issues could appear during submission. Please use it at your own risk. Feedback and suggestions are welcome!
**Beta Version**: v1.2.5. This pipeline is currently in Beta testing, and issues could appear during submission. Please use it at your own risk. Feedback and suggestions are welcome!

**General Disclaimer**: This repository was created for use by CDC programs to collaborate on public health related projects in support of the [CDC mission](https://www.cdc.gov/about/organization/mission.htm). GitHub is not hosted by the CDC, but is a third party website used by CDC and its partners to share information and collaborate on software. CDC use of GitHub does not imply an endorsement of any one particular service, product, or enterprise.

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@
![Docker image size](https://img.shields.io/docker/image-size/cdcgov/seqsender)
![GitHub last commit](https://img.shields.io/github/last-commit/cdcgov/seqsender)

**Beta Version**: 1.2.3. This pipeline is currently in Beta testing, and
<!-- ![GitHub issues](https://img.shields.io/github/issues/montilab/cadra) -->

<!-- ![GitHub last commit](https://img.shields.io/github/last-commit/montilab/cadra) -->

<p style="font-size: 16px;">

<em>Public Database Submission Pipeline</em>

</p>

**Beta Version**: 1.2.5. This pipeline is currently in Beta testing, and
issues could appear during submission. Please use it at your own risk.
Feedback and suggestions are welcome\!

Expand Down
10 changes: 5 additions & 5 deletions config/seqsender/config_file/gisaid_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
'Username': {
'required': False,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+',
'regex': '\s*[\S]+\s*',
'nullable': True
},
'Password': {
'required': False,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+',
'regex': '\s*[\S]+\s*',
'nullable': True
},
'Spuid_Namespace': {
'required': False,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+',
'regex': '\s*[\S]+\s*',
'nullable': True
},
'BioSample_Package': {
Expand Down Expand Up @@ -191,12 +191,12 @@
'Username': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'Password': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'Submission_Position': {
'required': False,
Expand Down
10 changes: 5 additions & 5 deletions config/seqsender/config_file/ncbi_gisaid_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
'Username': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'Password': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'Spuid_Namespace': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'BioSample_Package': {
'required': False,
Expand Down Expand Up @@ -173,12 +173,12 @@
'Username': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'Password': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'Submission_Position': {
'required': True,
Expand Down
10 changes: 5 additions & 5 deletions config/seqsender/config_file/ncbi_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
'Username': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'Password': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'Spuid_Namespace': {
'required': True,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+'
'regex': '\s*[\S]+\s*'
},
'BioSample_Package': {
'required': False,
Expand Down Expand Up @@ -174,13 +174,13 @@
'Username': {
'required': False,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+',
'regex': '\s*[\S]+\s*',
'nullable': True
},
'Password': {
'required': False,
'type': 'string',
'regex': '^[a-zA-Z0-9_.+-]+',
'regex': '\s*[\S]+\s*',
'nullable': True
},
'Submission_Position': {
Expand Down
15 changes: 10 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ version: "3.9"
x-data-volumes:
&data-volume
type: bind
source: $HOME/Github/Testings/seqsender
source: $HOME
target: /data

services:
seqsender:
seqsender:
container_name: seqsender
image: cdcgov/seqsender:latest
image: seqsender:latest
build:
context: .
dockerfile: Dockerfile
args:
- micromamba_version=1.5.3
restart: always
volumes:
volumes:
- *data-volume
command: tail -f /dev/null
command: tail -f /dev/null
2 changes: 1 addition & 1 deletion docs/app.json

Large diffs are not rendered by default.

Loading

0 comments on commit 6d42208

Please sign in to comment.