-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development image to test PopPunk branches #50
Merged
Merged
Changes from 27 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
054bc41
refactor: replace Dockerfile with separate production and development…
absternator e9acf2d
fix: update development image tags to include SHA for better versioning
absternator f5b8ab6
fix: streamline Dockerfile.dev by consolidating package installations…
absternator 996b8bb
fix: update Dockerfile.dev to install Python 3.10
absternator ae8e61d
fix: correct Dockerfile.dev syntax by removing redundant RUN command
absternator 180e907
fix: separate package installations in Dockerfile.dev for clarity and…
absternator a963269
fix: update mandrake installation in Dockerfile.dev to use classic so…
absternator 5d05f6c
fix: correct typo in Dockerfile.dev for rapidnj installation solver
absternator a2aa01c
fet workimg verison
absternator f429068
fix: uncomment Dockerfile.dev commands for improved installation proc…
absternator 35ed678
fix: update CMD in Dockerfile.dev to use array syntax for improved co…
absternator 34e158f
fix: update Dockerfile.dev to use base environment and streamline com…
absternator a1ac4e7
docs: update README.md with deployment instructions and local develop…
absternator e0203a7
docs: update README.md and build scripts to include --with-dev flag f…
absternator 912047a
docs: add note to README.md to remove --with-dev flag before merging PR
absternator a2dc8dd
fix: update CMD in Dockerfile.dev to use conda instead of mamba for c…
absternator 55b5c50
fix: update README.md and Dockerfile.dev to use POPPUNK_VERSION varia…
absternator 9fb3c5b
fix: simplify CMD in Dockerfile.dev by removing unnecessary bash invo…
absternator bfc77ac
fix: update CMD in Dockerfile.dev to use bash for command execution
absternator e22937c
fix: update CMD in Dockerfile.dev to use absolute path for bash
absternator fbfebb4
fix: update CMD in Dockerfile.dev to streamline conda command execution
absternator 5cf6820
try github container registry
absternator 0200a4b
fix: streamline GIT_SHA and GIT_BRANCH retrieval in docker/common
absternator b69e2a1
fix: update PACKAGE_ORG in docker/common to use bacpop
absternator cc62344
remove buildkte
absternator d84fb09
fix: update workflow name to reflect multiple docker images
absternator dfeeacb
fix: set CONDA_OVERRIDE_ARCHSPEC to ensure correct architecture for c…
absternator 24f1611
fix: update branch pattern in workflow and improve README formatting
absternator f9b363b
fix: remove development flags from docker build and push commands
absternator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: build and push docker images | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- '*' | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to GHCR (GitHub Packages) | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build docker image | ||
run: ./docker/build --with-dev # TODO: remove --with_dev before merging | ||
- name: Push SHA docker image | ||
run: ./docker/push --with-dev # TODO: remove --with_dev before merging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -101,3 +101,19 @@ Testing can be done in a second terminal (make sure to activate 'beebop_py') by | |||||||
``` | ||||||||
TESTING=True poetry run pytest | ||||||||
``` | ||||||||
|
||||||||
### Use/Deploy specific version of PopPUNK | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think the next two sections are about this top, so this should be a higher level heading. |
||||||||
|
||||||||
To use a specific version, commit or branch of PopPUNK in a beebop_py deployment, you can update `POPPUNK_VERSION` in `common`. | ||||||||
|
||||||||
The new dev images built with `/docker/build --with-dev` will have a *-dev* postfix. | ||||||||
|
||||||||
### Local Development | ||||||||
|
||||||||
You can build the image with `/docker/build --with-dev`, this new image can now be used by Beebop. | ||||||||
|
||||||||
### Deployment | ||||||||
|
||||||||
A pull request can be created so GHA pushes the images to the docker hub. Add `--with-dev` to the build & push commands `pipeline.yaml`. | ||||||||
**Ensure to remove the `--with-dev` flag before merging the PR.** | ||||||||
Then on the `beebop-deploy` the api image can be updated with the new dev image. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
FROM continuumio/miniconda3 | ||
|
||
# ensure conda does not install packages for the wrong architecture | ||
ENV CONDA_OVERRIDE_ARCHSPEC=skylake | ||
|
||
ARG POPPUNK_VERSION="v2.6.7" | ||
|
||
# Make RUN commands use the new environment: | ||
SHELL ["conda", "run", "-n", "base", "/bin/bash", "-c"] | ||
|
||
# Set up conda environment | ||
RUN conda install python=3.10 | ||
RUN conda config --append channels conda-forge && \ | ||
conda config --append channels bioconda | ||
|
||
# Install mamba: which is a faster package manager than conda | ||
RUN conda install -c conda-forge mamba | ||
RUN conda config --set channel_priority flexible | ||
|
||
#Install PopPUNK conda dependencies | ||
RUN mamba install -y -c conda-forge -y graph-tool mandrake | ||
RUN mamba install -y \ | ||
# Core data packages | ||
pandas \ | ||
requests \ | ||
networkx \ | ||
scikit-learn \ | ||
# Bioinformatics tools | ||
pp-sketchlib \ | ||
biopython \ | ||
treeswift \ | ||
rapidnj \ | ||
# Analysis tools | ||
hdbscan \ | ||
# Progress tracking | ||
tqdm \ | ||
&& mamba clean -afy | ||
|
||
# System dependencies | ||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
build-essential \ | ||
cmake \ | ||
libeigen3-dev \ | ||
libhdf5-dev \ | ||
libopenblas-dev | ||
|
||
|
||
RUN pip install git+https://github.com/bacpop/PopPUNK@${POPPUNK_VERSION}#egg=PopPUNK | ||
|
||
# Poetry setup | ||
RUN pip install poetry | ||
COPY *.toml *.lock / | ||
RUN poetry config virtualenvs.create false && \ | ||
poetry install | ||
|
||
COPY . /beebop | ||
WORKDIR /beebop | ||
EXPOSE 5000 | ||
|
||
CMD ["conda", "run" ,"--no-capture-output", "-n", "base", "poetry", "run", "waitress-serve", "--port=5000", "beebop.app:app"] |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
REGISTRY=ghcr.io | ||
PACKAGE_ROOT=$(realpath $HERE/..) | ||
PACKAGE_NAME=beebop-py | ||
PACKAGE_ORG=mrcide | ||
PACKAGE_ORG=bacpop | ||
PACKAGE_DEV=dev | ||
|
||
# Buildkite doesn't check out a full history from the remote (just the | ||
# single commit) so you end up with a detached head and git rev-parse | ||
# doesn't work | ||
if [ "$BUILDKITE" = "true" ]; then | ||
GIT_SHA=${BUILDKITE_COMMIT:0:7} | ||
GIT_SHA=$(git -C "$PACKAGE_ROOT" rev-parse --short=7 HEAD) | ||
if [[ -v "BRANCH_NAME" ]]; then | ||
GIT_BRANCH=${BRANCH_NAME} | ||
else | ||
GIT_SHA=$(git -C "$PACKAGE_ROOT" rev-parse --short=7 HEAD) | ||
GIT_BRANCH=$(git symbolic-ref --short HEAD) | ||
fi | ||
|
||
if [ "$BUILDKITE" = "true" ]; then | ||
GIT_BRANCH=$BUILDKITE_BRANCH | ||
else | ||
GIT_BRANCH=$(git -C "$PACKAGE_ROOT" symbolic-ref --short HEAD) | ||
fi | ||
# production image | ||
TAG_SHA="${REGISTRY}/${PACKAGE_ORG}/${PACKAGE_NAME}:${GIT_SHA}" | ||
TAG_BRANCH="${REGISTRY}/${PACKAGE_ORG}/${PACKAGE_NAME}:${GIT_BRANCH}" | ||
TAG_LATEST="${REGISTRY}/${PACKAGE_ORG}/${PACKAGE_NAME}:latest" | ||
|
||
TAG_SHA="${PACKAGE_ORG}/${PACKAGE_NAME}:${GIT_SHA}" | ||
TAG_BRANCH="${PACKAGE_ORG}/${PACKAGE_NAME}:${GIT_BRANCH}" | ||
TAG_LATEST="${PACKAGE_ORG}/${PACKAGE_NAME}:latest" | ||
# development image | ||
TAG_DEV_SHA="${REGISTRY}/${TAG_SHA}-${PACKAGE_DEV}" | ||
TAG_DEV_BRANCH="${REGISTRY}/${TAG_BRANCH}-${PACKAGE_DEV}" | ||
POPPUNK_VERSION=v2.6.7 # can be version, branch or commit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pushes both branch and tag doesn't it? So this name is a bit misleading.
In some projects we delay pushing the branch tag until tests have passed - can't remember what we were doing in this one on buildkite.