Skip to content

Commit

Permalink
Merge pull request #6 from blooop/feature/update_from_template
Browse files Browse the repository at this point in the history
Feature/update from template
  • Loading branch information
blooop authored Nov 2, 2024
2 parents afcf011 + 6dcac42 commit f7d366e
Show file tree
Hide file tree
Showing 11 changed files with 297 additions and 303 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*.dae filter=lfs diff=lfs merge=lfs -text
*.obj filter=lfs diff=lfs merge=lfs -text
*.ply filter=lfs diff=lfs merge=lfs -text
*.usd filter=lfs diff=lfs merge=lfs -text

# Compiled libraries
*.a filter=lfs diff=lfs merge=lfs -text
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
environment: [py308, py309, py310, py311, py312]

environment: [py309, py310, py311, py312, py313]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[![GitHub pull-requests merged](https://badgen.net/github/merged-prs/blooop/pixi_rocker)](https://github.com/blooop/pixi_rocker/pulls?q=is%3Amerged)
[![GitHub release](https://img.shields.io/github/release/blooop/pixi_rocker.svg)](https://GitHub.com/blooop/pixi_rocker/releases/)
[![License](https://img.shields.io/github/license/blooop/pixi_rocker)](https://opensource.org/license/mit/)
[![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue)](https://www.python.org/downloads/)
[![Python](https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)](https://www.python.org/downloads/)
[![Pixi Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json)](https://pixi.sh)

## Intro
Expand Down
529 changes: 265 additions & 264 deletions pixi.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ channels = ["conda-forge"]
platforms = ["linux-64"]

[tool.pixi.dependencies]
python = ">=3.8"
python = ">=3.9"

[tool.pixi.feature.py308.dependencies]
python = "3.8.*"
[tool.pixi.feature.py309.dependencies]
python = "3.9.*"
[tool.pixi.feature.py310.dependencies]
Expand All @@ -29,6 +27,8 @@ python = "3.10.*"
python = "3.11.*"
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.py313.dependencies]
python = "3.13.*"


[tool.pixi.pypi-dependencies]
Expand All @@ -38,11 +38,11 @@ pixi_rocker = { path = ".", editable = true }
test = [
"black>=23,<=24.10.0",
"pylint>=3.2.5,<=3.3.1",
"pytest-cov>=4.1,<=5.0.0",
"pytest-cov>=4.1,<=6.0.0",
"pytest>=7.4,<=8.3.3",
"hypothesis>=6.104.2,<=6.112.5",
"ruff>=0.5.0,<=0.6.9",
"coverage>=7.5.4,<=7.6.1",
"hypothesis>=6.104.2,<=6.116.0",
"ruff>=0.5.0,<=0.7.2",
"coverage>=7.5.4,<=7.6.4",
]

[build-system]
Expand All @@ -58,11 +58,11 @@ pixi = "pixi_rocker.pixi:PixiExtension"
# Environments
[tool.pixi.environments]
default = {features = ["test"], solve-group = "default" }
py308 = ["py308","test"]
py309 = ["py309","test"]
py310 = ["py310","test"]
py311 = ["py311","test"]
py312 = ["py312","test"]
py313 = ["py313","test"]


[tool.pixi.tasks]
Expand All @@ -82,7 +82,7 @@ update-lock-push = { depends_on = ["update-lock", "push"] }
fix = { depends_on = ["update-lock", "format", "ruff-lint"] }
fix-commit-push = { depends_on = ["fix", "commit-format", "update-lock-push"] }
ci-no-cover = { depends_on = ["style", "test"] }
ci = { depends_on = ["format","ruff-lint","check-clean-workspace","pylint", "coverage", "coverage-report"] }
ci = { depends_on = ["format","ruff-lint", "pylint", "coverage", "coverage-report"] }
ci-push = {depends_on=["format","ruff-lint","update-lock","ci","push"]}
clear-pixi = "rm -rf .pixi pixi.lock"
setup-git-merge-driver = "git config merge.ourslock.driver true"
Expand Down
9 changes: 0 additions & 9 deletions python_template.deps.yaml

This file was deleted.

22 changes: 12 additions & 10 deletions scripts/setup_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo apt update
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
Expand All @@ -20,28 +20,26 @@ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt update

# Install docker
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
#END OFFICIAL DOCKER INSTALL

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker


#INSTALL NVIDIA DOCKER
#https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo apt update
sudo apt install -y nvidia-docker2 nvidia-container-toolkit
sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

sudo apt install git-lfs
sudo apt install -y git-lfs

#Install rocker and rocker extensions which are used to launch the devcontainer
# pip install rocker off-your-rocker git+https://github.com/blooop/deps_rocker
Expand All @@ -55,3 +53,7 @@ echo "you may need to restart your machine"
#INSTALL PIXI
curl -fsSL https://pixi.sh/install.sh | bash
echo 'eval "$(pixi completion --shell bash)"' >> ~/.bashrc

sudo groupadd docker
sudo usermod -aG docker $USER
newgrp docker || true
2 changes: 1 addition & 1 deletion scripts/update_from_python_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#THIS IS USED TO UPDATE THIS TEMPLATE FROM THE MAIN PYTHON TEMPLATE https://github.com/blooop/python_template. YOU SHOULD NOT NEED TO USE THIS, PLEASE USE update_from_template.sh INSTEAD IF YOU WANT TO PULL UPDATES FROM TEMPLATE_ROCKER

git config --global pull.rebase false
git config pull.rebase false
git remote add template https://github.com/blooop/python_template.git
git fetch --all
git checkout main && git pull origin main
Expand Down
2 changes: 1 addition & 1 deletion scripts/update_from_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#THIS IS THE CORRECT TEMPLATE UPDATE SCRIPT, NOT update_from_python_template.sh

git config --global pull.rebase false
git config pull.rebase false
git remote add template https://github.com/blooop/template_rocker.git
git fetch --all
git checkout main && git pull origin main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
from rocker.extensions import RockerExtension


class NewRockerExtension(RockerExtension):
class TemplateRocker(RockerExtension):
@staticmethod
def get_name():
return "new_rocker_extension"
return "template_rocker"

def __init__(self):
self.name = NewRockerExtension.get_name()
self.name = TemplateRocker.get_name()

def get_snippet(self, cliargs):
return pkgutil.get_data("template_rocker", "templates/curl_snippet.Dockerfile").decode(
Expand All @@ -25,8 +25,8 @@ def register_arguments(parser, defaults=None):
if defaults is None:
defaults = {}
parser.add_argument(
f"--{NewRockerExtension.get_name()}",
f"--{TemplateRocker.get_name()}",
action="store_true",
default=defaults.get("new_rocker_extension"),
help="add new_rocker_extension to your docker image",
default=defaults.get("template_rocker"),
help="add template_rocker to your docker image",
)

0 comments on commit f7d366e

Please sign in to comment.