-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'AoI2TA' of https://github.com/Ettrig/fAIr into AoI2TA
- Loading branch information
Showing
3 changed files
with
81 additions
and
22 deletions.
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,72 @@ | ||
name: Build and Publish Docker Images | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
build-and-push-api-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for API Docker | ||
id: meta_api | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}_api | ||
|
||
- name: Build and push API Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: backend/ | ||
file: backend/Dockerfile_CPU | ||
push: true | ||
tags: ${{ steps.meta_api.outputs.tags }} | ||
labels: ${{ steps.meta_api.outputs.labels }} | ||
|
||
build-and-push-worker-image: | ||
needs: build-and-push-api-image | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Worker Docker | ||
id: meta_worker | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}_worker | ||
|
||
- name: Build and push Worker Docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: backend/ | ||
file: backend/Dockerfile | ||
push: true | ||
tags: ${{ steps.meta_worker.outputs.tags }} | ||
labels: ${{ steps.meta_worker.outputs.labels }} |
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,38 +1,31 @@ | ||
# Use a specific base image with GPU support | ||
FROM tensorflow/tensorflow:2.9.2-gpu | ||
|
||
# Update package lists and install necessary dependencies in a single step | ||
RUN apt-get update && \ | ||
apt-get install -y python3-opencv gdal-bin libgdal-dev && \ | ||
add-apt-repository ppa:ubuntugis/ppa && \ | ||
apt-get update && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set environment variables for GDAL | ||
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal | ||
ENV C_INCLUDE_PATH=/usr/include/gdal | ||
|
||
# Install specific version of NumPy | ||
RUN pip install numpy==1.23.5 | ||
|
||
# Install GDAL with specified options | ||
RUN pip install numpy==1.23.5 | ||
RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==$(gdal-config --version) | ||
|
||
# Copy and install Python requirements | ||
|
||
COPY docker/ramp/docker-requirements.txt /tmp/docker-requirements.txt | ||
RUN pip install -r /tmp/docker-requirements.txt | ||
|
||
# Upgrade setuptools | ||
RUN pip install --upgrade setuptools | ||
|
||
RUN pip install --upgrade setuptools | ||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
# Install solaris and scikit-fmm packages | ||
|
||
COPY docker/ramp/solaris /tmp/solaris | ||
RUN pip install /tmp/solaris --use-feature=in-tree-build && \ | ||
pip install scikit-fmm --use-feature=in-tree-build | ||
|
||
# Set working directory and copy the application code | ||
|
||
WORKDIR /app | ||
COPY . /app |
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,39 +1,33 @@ | ||
# Use a specific base image with the desired TensorFlow version | ||
FROM tensorflow/tensorflow:2.9.2 | ||
|
||
# Update package lists and install necessary dependencies in a single step | ||
RUN apt-get update && \ | ||
apt-get install -y software-properties-common python3-opencv && \ | ||
add-apt-repository ppa:ubuntugis/ppa && \ | ||
apt-get update && \ | ||
apt-get install -y gdal-bin libgdal-dev && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Set environment variables for GDAL | ||
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal | ||
ENV C_INCLUDE_PATH=/usr/include/gdal | ||
|
||
# Install specific version of NumPy | ||
RUN pip install numpy==1.23.5 | ||
|
||
# Install GDAL with specified options | ||
RUN pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==$(gdal-config --version) | ||
|
||
# Copy and install Python requirements | ||
|
||
COPY docker/ramp/docker-requirements.txt /tmp/docker-requirements.txt | ||
RUN pip install -r /tmp/docker-requirements.txt | ||
|
||
# Upgrade setuptools | ||
|
||
RUN pip install --upgrade setuptools | ||
|
||
COPY requirements.txt /tmp/requirements.txt | ||
RUN pip install -r /tmp/requirements.txt | ||
|
||
# Install solaris and scikit-fmm packages | ||
COPY docker/ramp/solaris /tmp/solaris | ||
RUN pip install /tmp/solaris --use-feature=in-tree-build && \ | ||
pip install scikit-fmm --use-feature=in-tree-build | ||
|
||
# Set working directory and copy the application code | ||
WORKDIR /app | ||
COPY . /app | ||
|
||
# CMD ['python', 'manage.py', 'runserver', '0.0.0.0:8000'] |