Skip to content

Commit

Permalink
feat: add python image
Browse files Browse the repository at this point in the history
  • Loading branch information
Zitrone44 committed Apr 11, 2024
0 parents commit 79834a7
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# .github/workflows/ci.yml

name: Earthly +build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
FORCE_COLOR: 1
steps:
- uses: earthly/actions-setup@v1
with:
version: v0.8.0
- uses: actions/checkout@v4
- name: Login to GitHub Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run build
run: earthly --ci --push +all
31 changes: 31 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
VERSION 0.8

IMPORT ./language/python AS python
IMPORT ./language/julia AS julia
IMPORT ./frontend/jupyter AS jupyter
IMPORT ./frontend/code AS code

ARG --required --global REGISTRY
ARG --required --global VERSION

common:
FROM mambaorg/micromamba:1.5.8
RUN micromamba install -n base -c conda-forge -y htop nvtop

all:
BUILD +python-jupyter
BUILD +python-code

python:
FROM +common
DO python+SETUP

python-jupyter:
FROM +python
DO jupyter+SETUP
SAVE IMAGE $REGISTRY/python-jupyter:$VERSION

python-code:
FROM +python
DO code+SETUP
SAVE IMAGE $REGISTRY/python-code:$VERSION
10 changes: 10 additions & 0 deletions frontend/code/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
VERSION 0.8

SETUP:
FUNCTION
RUN micromamba install -n base -c conda-forge -y code-server ipykernel ipywidgets
RUN micromamba -n base run code-server \
--install-extension ms-toolsai.jupyter \
--install-extension equinusocio.vsc-material-theme \
--install-extension equinusocio.vsc-material-theme-icons \
--install-extension ms-python.python
5 changes: 5 additions & 0 deletions frontend/jupyter/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VERSION 0.8

SETUP:
FUNCTION
RUN micromamba install -n base -c conda-forge -y jupyterlab ipykernel ipywidgets
9 changes: 9 additions & 0 deletions language/python/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
VERSION 0.8

SETUP:
FUNCTION
RUN micromamba install -n base -c pytorch -c nvidia -c conda-forge -y \
python pytorch torchvision torchaudio pytorch-cuda=11.8 \
lightning torchinfo tensorboard tensorboardx \
transformers diffusers datasets accelerate evaluate optimum \
matplotlib seaborn plotly \

0 comments on commit 79834a7

Please sign in to comment.