Skip to content

Commit dbb8600

Browse files
authored
Merge pull request #36 from caracal-pipeline/ddf-kms
Experimental ddf kms support
2 parents 3053688 + 7d09332 commit dbb8600

File tree

8 files changed

+123
-4
lines changed

8 files changed

+123
-4
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,14 @@ This makes the ``build-cargo.py`` script available. The script is preconfigured
4949
The ``cultcargo`` folder contains YaML files with cab definitions.
5050

5151
If you would like to maintain your own image collection, write your own manifest and Dockerfiles following the cult-cargo example, and use the ``build-cargo.py`` script to build your images.
52+
53+
## Using cult-cargo as a standalone image repository
54+
55+
You don't even need to run stimela (or indeed install anything) to take advantage of the images packaged with cult-cargo. Take a look at the image repository on https://quay.io/organization/stimela2 to see what's available.
56+
57+
For example, if you want to run a wsclean image, just do:
58+
59+
```
60+
$ singularity build wsclean-3.3.sif docker:quay.io/stimela2/wsclean:3.3-cc0.1.2
61+
$ singularity exec wsclean-3.3.sif wsclean
62+
```

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

+20
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ images:
5454

5555
python-astro:
5656
versions:
57+
'3.10': {}
5758
'3.9': {}
5859
'3.8': {}
5960

@@ -157,6 +158,25 @@ images:
157158
latest:
158159
package: git+https://github.com/ratt-ru/pfb-clean@awskube
159160

161+
ddfacet:
162+
assign:
163+
# base image for generic Python-based packages
164+
base_python_image: python-astro:3.10
165+
# corresponding python binary
166+
python: python3.10
167+
versions:
168+
# experimental branch, Oleg only
169+
useapp-meerklass:
170+
experimental_dependencies:
171+
- /home/oms/projects/cult-cargo/cultcargo/images/ddfacet/DDFacet-useapp-meerklass
172+
- /home/oms/projects/cult-cargo/cultcargo/images/ddfacet/killMS-useapp-meerklass
173+
pre_install: |
174+
ADD DDFacet-useapp-meerklass DDFacet-branch
175+
ADD killMS-useapp-meerklass killMS-branch
176+
package: -e ./DDFacet-branch ./killMS-branch
177+
'0.8':
178+
package: DDFacet==0.8.0.0 killMS==3.2.0
179+
160180
mosaic-queen:
161181
assign:
162182
pre_install: RUN apt update && apt install -y montage && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt/archives

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"]

cultcargo/images/python-astro/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ FROM {REGISTRY}/base-cult:base-{BUNDLE_VERSION}
22

33
ENV DEBIAN_FRONTEND=noninteractive
44

5+
RUN apt-add-repository -y ppa:deadsnakes/ppa
6+
57
RUN apt-get update && apt-get install apt-utils && \
6-
apt-get install -y casacore-data casacore-tools python{VERSION}-dev \
7-
python3-pip python3-pytest python3-matplotlib \
8+
apt-get install -y casacore-data casacore-tools python{VERSION}-dev python{VERSION}-distutils \
9+
python3-pip python3-pytest python3-matplotlib curl\
810
&& rm -rf /var/lib/apt/lists/* \
911
&& rm -rf /var/cache/apt/archives
1012

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cult-cargo"
3-
version = "0.1.2"
3+
version = "0.1.2rc8"
44
description = "Curated cargo of standard radio astronomy packages for stimela 2.0"
55
authors = ["Oleg Smirnov, Sphesihle Makhathini"]
66
license = "MIT"

0 commit comments

Comments
 (0)