File tree Expand file tree Collapse file tree 3 files changed +97
-2
lines changed
Expand file tree Collapse file tree 3 files changed +97
-2
lines changed Original file line number Diff line number Diff line change 1+ name : Build & Push Docker Image
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 0 * * *'
6+
7+ workflow_dispatch :
8+
9+ jobs :
10+ build-and-push :
11+ if : github.ref == 'refs/heads/main'
12+ runs-on : ubuntu-latest
13+ permissions :
14+ contents : read
15+ packages : write
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Log in to GHCR
22+ uses : docker/login-action@v3
23+ with :
24+ registry : ghcr.io
25+ username : ${{ github.actor }}
26+ password : ${{ secrets.GITHUB_TOKEN }}
27+
28+ - name : Build and push image
29+ uses : docker/build-push-action@v5
30+ with :
31+ context : .
32+ push : true
33+ tags : ghcr.io/ibm/terratorch:nightly
Original file line number Diff line number Diff line change 1+ name : Build & Push Docker Image (stream)
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ build-and-push :
10+ if : github.ref == 'refs/heads/main'
11+ runs-on : ubuntu-latest
12+ permissions :
13+ contents : read
14+ packages : write
15+
16+ steps :
17+ - name : Checkout code
18+ uses : actions/checkout@v4
19+
20+ - name : Log in to GHCR
21+ uses : docker/login-action@v3
22+ with :
23+ registry : ghcr.io
24+ username : ${{ github.actor }}
25+ password : ${{ secrets.GITHUB_TOKEN }}
26+
27+ - name : Build and push image
28+ uses : docker/build-push-action@v5
29+ with :
30+ context : .
31+ push : true
32+ tags : ghcr.io/ibm/terratorch:stream
Original file line number Diff line number Diff line change 1- FROM registry.access.redhat.com/ubi8/python-312:latest
2- RUN pip install terratorch
1+ FROM nvidia/cuda:12.9.0-cudnn-runtime-ubuntu24.04
2+
3+ ENV DEBIAN_FRONTEND=noninteractive
4+
5+ RUN mkdir -p /opt/app-root/src
6+ RUN chown -R 10000:0 /opt/app-root
7+ RUN chmod -R g+rwX /opt/app-root
8+
9+ RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
10+ RUN apt update && apt install -y tzdata
11+ RUN dpkg-reconfigure --frontend noninteractive tzdata
12+
13+ RUN apt-get update && apt-get install -y python3 python3-venv python3-pip git build-essential
14+ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
15+
16+ WORKDIR /opt/app-root/src
17+
18+ # Create venv and install terratorch
19+ USER 10000
20+ RUN python3 -m venv /opt/app-root/src/venv
21+ RUN chgrp 0 -R /opt/app-root/src/venv/
22+ RUN chmod 775 -R /opt/app-root/src/venv
23+ RUN . /opt/app-root/src/venv/bin/activate && pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir terratorch
24+ USER root
25+ RUN pip cache purge
26+
27+ RUN apt-get purge -y build-essential && \
28+ apt-get autoremove -y && \
29+ rm -rf /var/lib/apt/lists/*
30+
31+
32+ CMD ["bash" ]
You can’t perform that action at this time.
0 commit comments