calkit-python 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {calkit_python-0.2.0 → calkit_python-0.2.1}/PKG-INFO +1 -1
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/__init__.py +1 -1
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cli/main.py +10 -2
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cli/new.py +2 -1
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/docker.py +5 -3
- {calkit_python-0.2.0 → calkit_python-0.2.1}/.github/FUNDING.yml +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/.github/workflows/publish-test.yml +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/.github/workflows/publish.yml +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/.gitignore +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/LICENSE +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/README.md +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cli/__init__.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cli/config.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cli/core.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cli/import_.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cli/list.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cli/notebooks.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/cloud.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/config.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/core.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/data.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/dvc.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/git.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/gui.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/jupyter.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/models.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/server.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/tests/__init__.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/tests/cli/__init__.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/tests/cli/test_list.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/tests/cli/test_main.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/tests/cli/test_new.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/tests/test_core.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/tests/test_dvc.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/calkit/tests/test_jupyter.py +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/examples/cfd-study/README.md +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/examples/cfd-study/calkit.yaml +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/examples/cfd-study/config/simulations/runs.csv +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/examples/cfd-study/notebook.ipynb +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/examples/ms-office/.gitignore +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/examples/ms-office/README.md +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/examples/ms-office/calkit.yaml +0 -0
- {calkit_python-0.2.0 → calkit_python-0.2.1}/pyproject.toml +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
+
import hashlib
|
|
5
6
|
import json
|
|
6
7
|
import os
|
|
7
8
|
import subprocess
|
|
@@ -583,6 +584,10 @@ def build_docker(
|
|
|
583
584
|
except subprocess.CalledProcessError:
|
|
584
585
|
typer.echo(f"No image with tag {tag} found locally")
|
|
585
586
|
inspect = []
|
|
587
|
+
typer.echo(f"Reading Dockerfile from {fpath}")
|
|
588
|
+
with open(fpath) as f:
|
|
589
|
+
dockerfile = f.read()
|
|
590
|
+
dockerfile_md5 = hashlib.md5(dockerfile.encode()).hexdigest()
|
|
586
591
|
lock_fpath = fpath + "-lock.json"
|
|
587
592
|
rebuild = True
|
|
588
593
|
if os.path.isfile(lock_fpath):
|
|
@@ -593,11 +598,14 @@ def build_docker(
|
|
|
593
598
|
typer.echo(f"Lock file ({lock_fpath}) does not exist")
|
|
594
599
|
lock = None
|
|
595
600
|
if inspect and lock:
|
|
596
|
-
typer.echo("Checking image against lock file")
|
|
597
|
-
rebuild = inspect[0]["RootFS"]["Layers"] != lock[0]["RootFS"][
|
|
601
|
+
typer.echo("Checking image and Dockerfile against lock file")
|
|
602
|
+
rebuild = inspect[0]["RootFS"]["Layers"] != lock[0]["RootFS"][
|
|
603
|
+
"Layers"
|
|
604
|
+
] or dockerfile_md5 != lock[0].get("DockerfileMD5")
|
|
598
605
|
if rebuild:
|
|
599
606
|
subprocess.check_call(["docker", "build", "-t", tag, "-f", fpath, "."])
|
|
600
607
|
# Write the lock file
|
|
601
608
|
inspect = get_docker_inspect()
|
|
609
|
+
inspect[0]["DockerfileMD5"] = dockerfile_md5
|
|
602
610
|
with open(lock_fpath, "w") as f:
|
|
603
611
|
json.dump(inspect, f, indent=4)
|
|
@@ -297,7 +297,8 @@ def new_docker_env(
|
|
|
297
297
|
]
|
|
298
298
|
)
|
|
299
299
|
repo.git.add("calkit.yaml")
|
|
300
|
-
|
|
300
|
+
if stage:
|
|
301
|
+
repo.git.add("dvc.yaml")
|
|
301
302
|
if not no_commit and repo.git.diff("--staged"):
|
|
302
303
|
repo.git.commit(["-m", f"Add Docker environment {name}"])
|
|
303
304
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Functionality for working with Docker."""
|
|
2
2
|
|
|
3
|
-
MAMBAFORGE_LAYER_TXT = """
|
|
3
|
+
MAMBAFORGE_LAYER_TXT = r"""
|
|
4
4
|
# Install Miniforge
|
|
5
5
|
ARG MINIFORGE_NAME=Mambaforge
|
|
6
6
|
ARG MINIFORGE_VERSION=24.3.0-0
|
|
@@ -40,8 +40,10 @@ RUN apt-get update > /dev/null && \
|
|
|
40
40
|
echo ". ${CONDA_DIR}/etc/profile.d/conda.sh && conda activate base" >> ~/.bashrc
|
|
41
41
|
""".strip()
|
|
42
42
|
|
|
43
|
-
FOAMPY_LAYER_TEXT = """
|
|
44
|
-
RUN pip install numpy pandas matplotlib
|
|
43
|
+
FOAMPY_LAYER_TEXT = r"""
|
|
44
|
+
RUN pip install --no-cache-dir numpy pandas matplotlib h5py \
|
|
45
|
+
&& pip install --no-cache-dir scipy \
|
|
46
|
+
&& pip install --no-cache-dir foampy
|
|
45
47
|
""".strip()
|
|
46
48
|
|
|
47
49
|
LAYERS = {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|