Skip to content

Commit 8586163

Browse files
committed
added support for experimental branches
1 parent 0fe8b47 commit 8586163

File tree

5 files changed

+111
-3
lines changed

5 files changed

+111
-3
lines changed

cultcargo/builder/build_cargo.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ def run(command, cwd=None, input=None):
6969
@click.option('-p', '--push', is_flag=True, help='Push only, do not build.')
7070
@click.option('-r', '--rebuild', is_flag=True, help='Ignore docker image caches (i.e. rebuild).')
7171
@click.option('-a', '--all', is_flag=True, help='Build and/or push all images in manifest.')
72+
@click.option('-E', '--experimental', is_flag=True, help='Enable experimental versions.')
7273
@click.option('-v', '--verbose', is_flag=True, help='Be verbose.')
7374
@click.option('--boring', is_flag=True, help='Be boring -- no progress bar.')
7475
@click.argument('imagenames', type=str, nargs=-1)
75-
def build_cargo(manifest: str, do_list=False, build=False, push=False, all=False, rebuild=False, boring=False, verbose=False, imagenames: List[str] = []):
76+
def build_cargo(manifest: str, do_list=False, build=False, push=False, all=False, rebuild=False, boring=False,
77+
experimental=False, verbose=False, imagenames: List[str] = []):
7678
if not (build or push or do_list):
7779
build = push = True
7880

@@ -252,6 +254,20 @@ def resolve_config_reference(value):
252254
version_vars["VERSION"] = version
253255
version_vars["IMAGE_VERSION"] = image_version
254256

257+
is_exp = version_info.get('experimental')
258+
exp_deps = version_info.get('experimental_dependencies', [])
259+
260+
if is_exp or exp_deps:
261+
if not experimental:
262+
print(f"[bold]{image}:{image_version}[/bold] is experimental and -E switch not given, skipping")
263+
continue
264+
# check dependencies
265+
print(f"[bold]{image}:{image_version}[/bold] is experimental")
266+
for dep in exp_deps:
267+
if not os.path.exists(dep):
268+
print(f" [red]ERROR: dependency {dep} doesn't exist[/red]")
269+
return 1
270+
255271
dockerfile = version_info.get('dockerfile') or image_info.dockerfile or 'Dockerfile'
256272
dockerfile = dockerfile.format(**version_vars)
257273
full_image = f"{registry}/{image}:{image_version}"

cultcargo/builder/cargo-manifest.yml

+24-2
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,30 @@ images:
165165
# corresponding python binary
166166
python: python3.10
167167
versions:
168-
latest:
169-
package: git+https://github.com/saopicc/DDFacet
168+
# experimental branch, Oleg only
169+
useapp-meerklass:
170+
experimental_dependencies:
171+
- /home/oms/projects/cult-cargo/cultcargo/images/ddfacet/DDFacet-useapp-meerklass
172+
pre_install: ADD DDFacet-useapp-meerklass DDFacet-branch
173+
package: -e ./DDFacet-branch
174+
'0.8':
175+
package: DDFacet==0.8.0.0
176+
177+
killms:
178+
assign:
179+
# base image for generic Python-based packages
180+
base_python_image: python-astro:3.10
181+
# corresponding python binary
182+
python: python3.10
183+
versions:
184+
# experimental branch, Oleg only
185+
useapp-meerklass:
186+
experimental_dependencies:
187+
- /home/oms/projects/cult-cargo/cultcargo/images/killms/killMS-useapp-meerklass
188+
pre_install: ADD killMS-useapp-meerklass killMS-branch
189+
package: -e ./killMS-branch
190+
'3.2':
191+
package: killMS==3.2.0
170192

171193
mosaic-queen:
172194
assign:

cultcargo/images/ddfacet/Dockerfile

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
FROM {REGISTRY}/{base_python_image}-{BUNDLE_VERSION}
2+
3+
RUN apt-get update && \
4+
apt-get -y install \
5+
dpkg-dev \
6+
libc-dev \
7+
cmake \
8+
git \
9+
wget \
10+
subversion \
11+
rsync \
12+
python3-virtualenv \
13+
python3-pip \
14+
libfftw3-dev \
15+
python3-numpy \
16+
libfreetype6 \
17+
libfreetype6-dev \
18+
libpng-dev \
19+
pkg-config \
20+
python3-dev \
21+
libboost-all-dev \
22+
libcfitsio-dev \
23+
libhdf5-dev \
24+
wcslib-dev \
25+
libatlas-base-dev \
26+
liblapack-dev \
27+
python3-tk \
28+
libreadline6-dev \
29+
subversion \
30+
liblog4cplus-dev \
31+
libhdf5-dev \
32+
libncurses5-dev \
33+
flex \
34+
bison \
35+
libbison-dev \
36+
libqdbm-dev \
37+
libgsl-dev \
38+
make \
39+
&& rm -rf /var/lib/apt/lists/* \
40+
&& rm -rf /var/cache/apt/archives
41+
42+
{pre_install}
43+
44+
RUN {python} -mpip install --use-pep517 --no-cache-dir -U matplotlib dask-ms python-casacore casadata
45+
RUN {python} -mpip install --use-pep517 --no-cache-dir {package} {extra_deps}
46+
47+
{post_install}
48+
49+
CMD ["DDF.py"]
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
###### Ubuntu Main Repos
2+
deb http://us.archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
3+
deb-src http://us.archive.ubuntu.com/ubuntu bionic main restricted universe multiverse
4+
###### Ubuntu Update Repos
5+
deb http://us.archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
6+
deb http://us.archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
7+
deb http://us.archive.ubuntu.com/ubuntu bionic-proposed main restricted universe multiverse
8+
deb http://us.archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse
9+
deb-src http://us.archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse
10+
deb-src http://us.archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse
11+
deb-src http://us.archive.ubuntu.com/ubuntu bionic-proposed main restricted universe multiverse
12+
deb-src http://us.archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse

cultcargo/images/killms/Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM {REGISTRY}/ddfacet:{BUNDLE_VERSION}
2+
3+
{pre_install}
4+
5+
RUN {python} -mpip install --use-pep517 --no-cache-dir {package} {extra_deps}
6+
7+
{post_install}
8+
9+
CMD ["kMS.py"]

0 commit comments

Comments
 (0)