Skip to content

Commit

Permalink
Updated dockerfile with paths and env
Browse files Browse the repository at this point in the history
  • Loading branch information
kks32 committed Jun 25, 2024
1 parent 5d8ce23 commit b230de8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ jobs:
- image: docker pull ghcr.io/geoelements/gns:config
steps:
- checkout
# GCC
- run:
name: Train & Test
command: |
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/train.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: GNS Train and Test

on:
workflow_run:
workflows: ["Build and Push to GHCR"]
types:
- completed
push:
pull_request:

Expand All @@ -14,6 +18,14 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Wait for GHCR build
if: github.event_name == 'workflow_run'
run: echo "Build and Push to GHCR workflow completed, proceeding with GNS Train and Test"

- name: Run without waiting
if: github.event_name != 'workflow_run'
run: echo "Build and Push to GHCR not triggered, proceeding with GNS Train and Test"

- name: Train & Test
run: |
TMP_DIR="./gns-sample"
Expand Down
24 changes: 18 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
FROM python:3.11

WORKDIR /home/gns
WORKDIR /app

COPY requirements.txt .

RUN pip3 install --upgrade pip
RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --user
RUN pip3 install torch_geometric --user
RUN pip3 install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.3.0+cpu.html --user
RUN pip3 install -r requirements.txt
RUN pip3 install --upgrade pip && \
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu && \
pip3 install torch_geometric && \
pip3 install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.3.0+cpu.html && \
pip3 install -r requirements.txt

ENV PYTHONPATH=/app

# Add Python path to PATH
ENV PATH="/usr/local/bin:${PATH}"

# Create a bash script to set up the environment
RUN echo '#!/bin/bash\n\
export PYTHONPATH=/app\n\
export PATH="/usr/local/bin:$PATH"\n\
exec "$@"' > /entrypoint.sh && chmod +x /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["/bin/bash"]

0 comments on commit b230de8

Please sign in to comment.