Skip to content

Docker auto build #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
name: Build and Push Docker Images

on:
#push:
# branches: [ "main" ]
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
inputs:
manual_version:
Expand All @@ -13,13 +16,22 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
VERSION: ${{ github.event.inputs.manual_version || '0.1.7' }}
DOCKER_BUILDKIT: 1

jobs:
build-and-push:
runs-on: ubuntu-latest
runs-on: self-hosted
steps:

- name: Clean workspace
run: |
git clean -ffdx
git reset --hard HEAD

- name: Checkout code
uses: actions/checkout@v3
with:
clean: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -30,9 +42,11 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

# For debugging
- name: List files
run: ls -R
- name: Purge Docker system
run: yes | docker system prune -a

- name: Check disk space
run: df -h

- name: Build and push CUDA image
uses: docker/build-push-action@v4
Expand Down
41 changes: 32 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ echo " - This script will install the following packages:"
echo " - pytorch=$PYTORCH_VERSION"
echo " - pytorch-cuda=$CUDA_VERSION"
echo " - torchvision"
if [ $INSTALL_TORCH_GEOMETRIC = "true" ]; then
if [[ "$INSTALL_TORCH_GEOMETRIC" = "true" ]]; then
echo " - torch-geometric"
echo " - torch-cluster"
echo " - torch-scatter"
Expand All @@ -104,7 +104,7 @@ echo " - python=`which python`"

# if -y flag was passed in, do not bother asking
#
if [ "$SKIP_ASKING" == "true" ]; then
if [[ "$SKIP_ASKING" == "true" ]]; then
yn="y"
else
read -p "Does all this look correct? (y/n) " yn
Expand All @@ -120,13 +120,36 @@ fi
# Exit immediately if anything fails
set -e

# Install git-lfs
echo "Installing git-lfs..."
echo "If this fails, install git-lfs with:"
echo ""
echo " sudo apt-get install git-lfs"
echo ""
git lfs install
# Check if git-lfs is already installed
if command -v git-lfs &> /dev/null; then
echo "git-lfs is already installed."
else
echo "Installing git-lfs..."
echo "If this fails, install git-lfs manually with:"
echo ""
echo " sudo apt-get install git-lfs"
echo ""

# Attempt to install git-lfs
if ! git lfs install --skip-repo; then
echo "Failed to install git-lfs. Please install it manually."
exit 1
fi

echo "git-lfs installed successfully."
fi

# Check if the pre-push hook already exists
if [ -f .git/hooks/pre-push ]; then
echo "A pre-push hook already exists. Skipping hook installation."
else
# Install the pre-push hook only if it doesn't exist
git lfs update --force
echo "git-lfs pre-push hook installed."
fi

echo "git-lfs setup complete."


# Only remove if NO_REMOVe is false
if [ "$NO_REMOVE" == "false" ]; then
Expand Down
Loading