Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b2819ca

Browse files
committedJan 28, 2025
Draft untested, nonreproducible, run-as-root apptainer backends
1 parent bbe0829 commit b2819ca

File tree

8 files changed

+177
-10
lines changed

8 files changed

+177
-10
lines changed
 

‎Clustering.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
11
id: clustering_example
2-
description: Clustering benchmark on Gagolewski's, true number of clusters plus minus 2.
3-
version: 1.1
2+
description: Clustering benchmark on Gagolewski's, true number of clusters plus minus 2. Caution dirty apptainer sifs.
3+
version: 1.1_root_apptainer
44
benchmarker: "Izaskun Mallona, Daniel Incicau"
55
storage: https://play.min.io
66
benchmark_yaml_spec: 0.01
77
storage_api: S3
88
storage_bucket_name: clustering_example
9-
software_backend: conda
9+
software_backend: apptainer
1010
software_environments:
1111
clustbench:
1212
description: "clustbench on py3.12.6"
1313
conda: envs/clustbench.yml
1414
easyconfig: zlib-1.2.8.eb # clustbench.eb
15+
apptainer: envs/clustbench.sif
1516
sklearn:
1617
description: "Daniel's on py3.12.6"
1718
conda: envs/sklearn.yml
19+
apptainer: envs/sklearn.sif
1820
R:
1921
description: "Daniel's R with readr, dplyr, mclust, caret"
2022
conda: envs/r.yml
23+
apptainer: envs/r.sif
2124
fcps:
2225
description: "CRAN's FCPS"
2326
conda: envs/fcps.yml
27+
apptainer: envs/fcps.sif
2428
stages:
2529

2630
## clustbench data ##########################################################
@@ -47,16 +51,16 @@ stages:
4751
# - values: ["--dataset_generator", "wut", "--dataset_name", "mk3"]
4852
# - values: ["--dataset_generator", "wut", "--dataset_name", "mk4"]
4953
# - values: ["--dataset_generator", "wut", "--dataset_name", "olympic"]
50-
- values: ["--dataset_generator", "wut", "--dataset_name", "smile"]
54+
# - values: ["--dataset_generator", "wut", "--dataset_name", "smile"]
5155
# - values: ["--dataset_generator", "wut", "--dataset_name", "stripes"]
5256
# - values: ["--dataset_generator", "wut", "--dataset_name", "trajectories"]
5357
# - values: ["--dataset_generator", "wut", "--dataset_name", "trapped_lovers"]
54-
- values: ["--dataset_generator", "wut", "--dataset_name", "twosplashes"]
58+
# - values: ["--dataset_generator", "wut", "--dataset_name", "twosplashes"]
5559
# - values: ["--dataset_generator", "wut", "--dataset_name", "windows"]
56-
- values: ["--dataset_generator", "wut", "--dataset_name", "x1"]
60+
# - values: ["--dataset_generator", "wut", "--dataset_name", "x1"]
5761
# - values: ["--dataset_generator", "wut", "--dataset_name", "x2"]
5862
# - values: ["--dataset_generator", "wut", "--dataset_name", "x3"]
59-
- values: ["--dataset_generator", "wut", "--dataset_name", "z1"]
63+
# - values: ["--dataset_generator", "wut", "--dataset_name", "z1"]
6064
# - values: ["--dataset_generator", "wut", "--dataset_name", "z2"]
6165
# - values: ["--dataset_generator", "wut", "--dataset_name", "z3"]
6266
outputs:

‎README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ A clustering example for omnibenchmark
77
3. Move to the cloned repository `cd clustering_example`
88
4. Run locally, somewhat in parallel `ob run benchmark -b Clustering.yaml --local --threads 6` (do not use lots of threads, this version uses conda and filesystem latency can be a problem)
99

10-
1110
# Clustbench attribution
1211

1312
by Marek Gagolewski, modified by Izaskun Mallona
@@ -75,7 +74,7 @@ by Marek Gagolewski, modified by Izaskun Mallona
7574
- args: ["--method", "FCPS_Clara"]
7675
- args: ["--method", "FCPS_PAM"]
7776
- Metric providers (several metrics)
78-
- https://github.com/imallona/clustbench_metrics
77+
- https://github.com/imallona/clustbench_metrics
7978
- args: ["--metric", "normalized_clustering_accuracy"]
8079
- args: ["--metric", "adjusted_fm_score"]
8180
- args: ["--metric", "adjusted_mi_score"]
@@ -89,14 +88,19 @@ by Marek Gagolewski, modified by Izaskun Mallona
8988
- args: ["--metric", "rand_score"]
9089
- Metric collector
9190
- https://github.com/imallona/clustering_report
92-
- Daniel
91+
- Daniel modules (independent from clustbench)
9392
- https://github.com/omnibenchmark-example/iris.git
9493
- https://github.com/omnibenchmark-example/penguins.git
9594
- https://github.com/omnibenchmark-example/kmeans.git
9695
- https://github.com/omnibenchmark-example/ward.git
9796
- https://github.com/omnibenchmark-example/ari.git
9897
- https://github.com/omnibenchmark-example/accuracy.git
9998

99+
100+
# Software backends
101+
102+
In `envs`: conda, apptainer, easybuild (lmod modules)
103+
100104
# Warnings
101105

102106
Mind we try to run clusterings specifying the true number of clusters +- 2. But sometimes the true number is k=3. Then we do `k=2, k=2, k=3, k=5, k=6` filling with k=2s as needed, and recomputing the same values multiple times (so runtimes are comparable across datasets, regardless of their true number of clusters).

‎envs/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Conda
2+
3+
### Files
4+
5+
- `clustbench.yml`
6+
- `fcps.yml`
7+
- `r.yml`
8+
- `sklearn.yml`
9+
10+
### How to build
11+
12+
Lorem ipsum
13+
14+
## Apptainer
15+
16+
### Files
17+
18+
- `clustbench_singularity.def`
19+
- `fcps_singularity.def`
20+
- `r_singularity.def`
21+
- `sklearn_singularity.def`
22+
23+
### How to build
24+
25+
- `build_singularity.sh`
26+
27+
## Easybuild
28+
29+
### Files
30+
31+
- `clustbench.eb`
32+
33+
### How to build
34+
35+
Lorem ipsum

‎envs/build_singularity.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
sudo singularity build sklearn.sif sklearn_singularity.def
4+
5+
sudo singularity build clustbench.sif clustbench_singularity.def
6+
7+
sudo singularity build r.sif r_singularity.def
8+
9+
sudo singularity build fcps.sif fcps_singularity.def

‎envs/clustbench_singularity.def

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Bootstrap: docker
2+
From: ubuntu:jammy-20240911.1
3+
4+
%labels
5+
6+
AUTHOR izaskun.mallona@gmail.com
7+
8+
%post
9+
10+
# Install python3.12
11+
apt-get update
12+
apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev \
13+
libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev python-is-python3 git
14+
15+
wget https://www.python.org/ftp/python/3.12.6/Python-3.12.6.tgz
16+
tar -xf Python-3.12.6.tgz
17+
cd Python-3.12.*/
18+
./configure --enable-optimizations
19+
make -j 4
20+
make altinstall
21+
22+
# virtualenv
23+
cd /opt
24+
python3.12 -m venv "default"
25+
. default/bin/activate
26+
27+
pip3 install "clustering-benchmarks==1.1.5" "wget" "fastcluster==1.2.6" "numpy==1.26.4" "scipy==1.14.1" \
28+
"isodate" "pydantic-core" \
29+
"genieclust==1.1.6" "pandas==2.2.3" "gitpython==3.1.43"
30+
31+
echo '. /opt/default/bin/activate' >> $SINGULARITY_ENVIRONMENT
32+
33+
%environment
34+
35+
. /opt/default/bin/activate
36+
echo $PATH
37+
python --version
38+
python3.12 --version

‎envs/fcps_singularity.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Bootstrap: docker
2+
From: rocker/tidyverse:4.4
3+
4+
%labels
5+
6+
AUTHOR izaskun.mallona@gmail.com
7+
8+
%post
9+
10+
# Install python packages
11+
12+
apt-get update
13+
apt-get -y install python3 python3-pip python3-dev python-is-python3 git
14+
15+
pip3 install -U argparse gitpython isodate pydantic-core
16+
17+
# Install R packages
18+
19+
Rscript -e 'BiocManager::install(c("fcps", "dbscan", "protoclust", "energy", "argparse"))'
20+
21+
%environment

‎envs/r_singularity.def

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Bootstrap: docker
2+
From: rocker/tidyverse:4.4
3+
4+
%labels
5+
6+
AUTHOR izaskun.mallona@gmail.com
7+
8+
%post
9+
10+
# Install python packages
11+
12+
apt-get update
13+
apt-get -y install python3 python3-pip python3-dev python-is-python3 git
14+
15+
pip3 install argparse gitpython isodate pydantic-core
16+
17+
#################################
18+
# Install R packages
19+
#################################
20+
21+
Rscript -e 'BiocManager::install(c("mclust", "caret", "readr", "argparse"))'
22+
23+
%environment

‎envs/sklearn_singularity.def

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Bootstrap: docker
2+
From: ubuntu:jammy-20240911.1
3+
4+
%labels
5+
6+
AUTHOR izaskun.mallona@gmail.com
7+
8+
%post
9+
10+
# Install python3.12
11+
apt-get update
12+
apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev \
13+
libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev python-is-python3 git
14+
15+
wget https://www.python.org/ftp/python/3.12.6/Python-3.12.6.tgz
16+
tar -xf Python-3.12.6.tgz
17+
cd Python-3.12.*/
18+
./configure --enable-optimizations
19+
make -j 4
20+
make altinstall
21+
22+
# virtualenv
23+
cd /opt
24+
python3.12 -m venv "default"
25+
. default/bin/activate
26+
27+
pip3 install -U scikit-learn pandas argparse numpy scipy "isodate" "pydantic-core" "gitpython==3.1.43"
28+
29+
echo '. /opt/default/bin/activate' >> $SINGULARITY_ENVIRONMENT
30+
31+
%environment
32+
33+
. /opt/default/bin/activate

0 commit comments

Comments
 (0)
Please sign in to comment.