Skip to content
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

Some environment updates and adding docker builds to ghcr #377

Merged
merged 5 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Docker Image

concurrency: ${{ github.workflow }}-${{ github.ref }}

on:
push:
tags:
- "*"

jobs:
build-tag:

runs-on: ubuntu-latest

permissions:
contents: write
packages: write

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

steps:
- name: "Checkout"
uses: actions/checkout@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and also push Dockerimage
id: build-and-push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
16 changes: 6 additions & 10 deletions .github/workflows/build.yml → .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,35 @@ jobs:
fail-fast: false
matrix:
include:
- name: Python 3.7 with required dependencies
os: macos-latest
python-version: 3.7
toxenv: py37-test

- name: Documentation build
os: ubuntu-latest
python-version: 3.8
python-version: 3.9
toxenv: build_docs

- name: Python 3.9 with developer version of astropy and numpy
os: ubuntu-latest
python-version: 3.9
toxenv: py39-test-devdeps

- name: Python 3.7 with older dependencies, astropy 3.0 and Numpy 1.17
- name: Python 3.8 with minimal dependencies
os: ubuntu-latest
python-version: 3.7
toxenv: py37-test-astropy30-numpy117
python-version: '3.8'
toxenv: py38-test

- name: Python 3.9 with minimal dependencies
os: ubuntu-latest
python-version: '3.9'
toxenv: py39-test

- name: Python 3.10 with minimal dependencies
os: ubuntu-latest
python-version: '3.10'
toxenv: py310-test

- name: Code style checks
os: ubuntu-latest
python-version: 3.8
python-version: 3.9
toxenv: codestyle

steps:
Expand Down
11 changes: 10 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
1.11.0 (2023-08-10)
1.13.0 (2023-10-31)
-------------------
- Refreshed build enviornment
- We now push tags to ghcr.io instead of an internal docker registry

1.12.0 (2023-08-10)
-------------------
- Added the process_by_group keyword to stages to fix a bug that wouldn't allow grouping only by instrument
- Updated the logging scheme
- Ack tasks late so that they may be re-queued in the event of a worker shutdown a la kubernetes

1.11.0 (2023-08-10)
-------------------
- Added optional dark temperature scaling

1.10.1 (2023-05-31)
-------------------
- We now silently fix fits errors that can be repaired automatically
Expand Down
30 changes: 15 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
FROM continuumio/miniconda3:4.10.3
FROM continuumio/miniconda3:23.5.2-0

RUN conda install -y numpy pip scipy astropy pytest mock requests ipython coverage pyyaml\
&& conda install -y -c conda-forge kombu=4.4.0 elasticsearch\<6.0.0,\>=5.0.0 pytest-astropy mysql-connector-python\
&& conda clean -y --all

RUN pip install --no-cache-dir cython logutils lcogt_logging python-dateutil sqlalchemy\>=1.3.0b1 psycopg2-binary celery[redis]==4.3.0 \
apscheduler ocs-ingester tenacity amqp==2.6.0 cosmic-conn
# In principle I could remove the gcc to shrink the image, but pytorch is already so large it doesn't make much difference
RUN apt-get -y update && apt-get -y install gcc && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/*

RUN mkdir /home/archive && /usr/sbin/groupadd -g 10000 "domainusers" \
&& /usr/sbin/useradd -g 10000 -d /home/archive -M -N -u 10087 archive \
&& chown -R archive:domainusers /home/archive

COPY --chown=10087:10000 . /lco/banzai

RUN apt-get -y update && apt-get -y install gcc && \
pip install --no-cache-dir git+https://github.com/cmccully/sep.git@deblending /lco/banzai/ && \
apt-get -y remove gcc && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/*

USER archive

ENV HOME /home/archive

WORKDIR /home/archive

COPY environment.yaml .

RUN . /opt/conda/etc/profile.d/conda.sh && conda env create -p /home/archive/envs/banzai -f environment.yaml --solver=libmamba

COPY --chown=10087:10000 . /lco/banzai

ENV PATH /home/archive/envs/banzai/bin:$PATH

RUN /home/archive/envs/banzai/bin/pip install --no-cache-dir /lco/banzai/
219 changes: 0 additions & 219 deletions Jenkinsfile

This file was deleted.

Loading
Loading