Skip to content

Commit

Permalink
Build Python docker image (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
parasj authored Dec 21, 2021
1 parent 9251d21 commit 6d376ab
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
data/
nb/
Dockerfile

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

.ipynb_checkpoints/
nb/.ipynb_checkpoints/
.idea/
.vscode/

.DS_Store
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# syntax=docker/dockerfile:1
FROM ghcr.io/parasj/skylark-docker-base:main
COPY . /pkg
RUN pip install /pkg
15 changes: 15 additions & 0 deletions scripts/pack_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
export DOCKER_BUILDKIT=1
cd "$(dirname "$0")/.."
mkdir -p ./dist

set -xe
sudo docker build -t skylark .
# sudo docker save skylark | pv > ./dist/skylark.tar
# du -sh ./dist/skylark.tar

RANDOM_TAG=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)
sudo docker tag skylark ghcr.io/parasj/skylark-docker:$RANDOM_TAG
sudo docker push ghcr.io/parasj/skylark-docker:$RANDOM_TAG
echo "Code stored in ghcr.io/parasj/skylark-docker:$RANDOM_TAG"
export SKYLARK_DOCKER_IMAGE="ghcr.io/parasj/skylark-docker:$RANDOM_TAG"
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
from setuptools import setup


setup(
name='skylark',
version='0.1',
packages=["skylark"],
python_requires=">=3.8",
install_requires=[
"boto3",
# "cylp",
"cvxpy",
"cvxopt",
"click",
"google-cloud-compute",
"cvxopt",
"cvxpy",
"google-api-python-client",
"google-cloud-compute",
"graphviz",
"loguru",
"matplotlib",
"numpy",
"pandas",
"paramiko",
"tqdm",
"questionary",
"tqdm",
],
extras_require={"test": ["black", "pytest", "ipython", "jupyter_console"]}
)

0 comments on commit 6d376ab

Please sign in to comment.