diff --git a/.circleci/config.yml b/.circleci/config.yml index 707003c..10ef020 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,6 @@ jobs: - image: docker pull ghcr.io/geoelements/gns:config steps: - checkout - # GCC - run: name: Train & Test command: | diff --git a/.github/workflows/train.yml b/.github/workflows/train.yml index 48eb18c..e85f8f3 100644 --- a/.github/workflows/train.yml +++ b/.github/workflows/train.yml @@ -1,6 +1,10 @@ name: GNS Train and Test on: + workflow_run: + workflows: ["Build and Push to GHCR"] + types: + - completed push: pull_request: @@ -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" diff --git a/Dockerfile b/Dockerfile index 306a949..2de8a2f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file