Skip to content

Commit

Permalink
Adding container test
Browse files Browse the repository at this point in the history
  • Loading branch information
jordancaraballo committed Sep 4, 2024
1 parent 27d0ac2 commit d9b52a8
Show file tree
Hide file tree
Showing 2 changed files with 173 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI to Dockerhub

on:
push:
branches:
- 'main'

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Lower github-runner storage
run: |
# Remove software and language runtimes we're not using
sudo rm -rf \
"$AGENT_TOOLSDIRECTORY" \
/opt/google/chrome \
/opt/microsoft/msedge \
/opt/microsoft/powershell \
/opt/pipx \
/usr/lib/mono \
/usr/local/julia* \
/usr/local/lib/android \
/usr/local/lib/node_modules \
/usr/local/share/chromium \
/usr/local/share/powershell \
/usr/share/dotnet \
/usr/share/swift
df -h /
-
name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./requirements/Dockerfile
push: true
tags: nasanccs/above-shrubs.pytorch:latest
118 changes: 118 additions & 0 deletions requirements/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Arguments to pass to the image
ARG VERSION_DATE=24.01
ARG FROM_IMAGE=nvcr.io/nvidia/pytorch

# Import RAPIDS container as the BASE Image (cuda base image)
FROM ${FROM_IMAGE}:${VERSION_DATE}-py3

# Ubuntu needs noninteractive to be forced
ENV DEBIAN_FRONTEND noninteractive
ENV PROJ_LIB="/usr/share/proj"
ENV CPLUS_INCLUDE_PATH="/usr/include/gdal"
ENV C_INCLUDE_PATH="/usr/include/gdal"

# System dependencies
# System dependencies
RUN apt-get update && \
apt-get -y install software-properties-common && \
add-apt-repository ppa:ubuntugis/ubuntugis-unstable && \
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \
apt-get update && apt-get -y dist-upgrade && \
apt-get -y install build-essential \
libsm6 \
libxext6 \
libxrender-dev \
libfontconfig1 \
bzip2 \
diffutils \
file \
build-essential \
make \
swig \
libnetcdf-dev \
libacl1-dev \
libgeos++-dev \
libgeos-dev \
libsqlite3-dev \
libx11-dev \
libproj-dev \
proj-data \
proj-bin \
libspatialindex-dev \
wget \
vim \
curl \
git \
procps \
gcc \
g++ \
bzip2 \
libssl-dev \
libzmq3-dev \
libpng-dev \
libfreetype6-dev \
locales \
git-lfs && \
apt-get -y install gdal-bin libgdal-dev && \
apt-get -y autoremove && \
rm -rf /var/cache/apt /var/lib/apt/lists/*

# Install shiftc
WORKDIR /app
RUN git clone --single-branch --branch master https://github.com/pkolano/shift.git && \
cd shift/c && \
make nolustre && \
cd ../ && \
install -m 755 perl/shiftc /usr/local/bin/ && \
install -m 755 c/shift-bin /usr/local/bin/ && \
install -m 755 perl/shift-mgr /usr/local/bin/ && \
install -m 644 etc/shiftrc /etc/ && \
install -m 755 perl/shift-aux /usr/local/bin/ && \
install -m 755 c/shift-bin /usr/local/bin/ && \
export LC_ALL=en_US.UTF-8 && \
export LANG=en_US.UTF-8 && \
locale-gen en_US.UTF-8 && \
rm -rf /app

# Pip
RUN pip --no-cache-dir install omegaconf \
terratorch \
pytorch-lightning \
Lightning \
transformers \
datasets \
webdataset \
deepspeed \
'huggingface_hub[cli,torch]' \
torchgeo \
rasterio \
rioxarray \
xarray \
xarray-spatial \
geopandas \
opencv-python \
opencv-python-headless \
opencv-contrib-python \
opencv-contrib-python-headless \
tifffile \
webcolors \
Pillow \
seaborn \
xgboost \
tiler \
segmentation-models \
timm \
supervision \
pytest \
coveralls \
rtree \
sphinx \
sphinx_rtd_theme \
yacs \
termcolor \
segmentation-models-pytorch \
GDAL==`ogrinfo --version | grep -Eo '[0-9]\.[0-9]\.[0-9]+'`

HEALTHCHECK NONE
ENTRYPOINT []
CMD ["/bin/bash"]

0 comments on commit d9b52a8

Please sign in to comment.