Skip to content
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

Build Python docker image #12

Merged
merged 2 commits into from
Dec 21, 2021
Merged
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
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"]}
)