Skip to content

Commit 3368192

Browse files
authored
Merge pull request #106 from inab/full_circle
Full circle 1.0.0a2
2 parents 8565ea5 + 7949d8a commit 3368192

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2095
-1202
lines changed

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ authors:
1515
given-names: Daniel
1616
orcid: "https://orcid.org/0000-0001-8152-0398"
1717
cff-version: 1.2.0
18-
date-released: "2024-04-24"
1918
identifiers:
2019
- description: WfExS-backend release in Zenodo
2120
type: doi
@@ -28,4 +27,5 @@ message: "If you use this software, please cite it using these metadata."
2827
repository-code: "https://github.com/inab/WfExS-backend"
2928
type: software
3029
title: "WfExS-backend"
31-
version: 1.0.0a1
30+
version: 1.0.0a2
31+
date-released: "2024-07-28"

INSTALL.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ just using next bash pattern:
1414

1515
```bash
1616
# WFEXS_VER can be either a branch, a tag or a commit hash
17-
WFEXS_VER=574fe343c0b59eecd95afbc67894456359ebe649
17+
WFEXS_VER=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
1818
docker build -t inab/wfexs-backend:${WFEXS_VER} \
1919
--build-arg wfexs_checkout="${WFEXS_VER}" \
2020
https://raw.githubusercontent.com/inab/WfExS-backend/${WFEXS_VER}/container_recipes/Dockerfile
@@ -25,7 +25,7 @@ a local copy of the recipe, and next command line from the project root will hel
2525

2626
```bash
2727
# WFEXS_VER can be either a branch, a tag or a commit hash
28-
WFEXS_VER=574fe343c0b59eecd95afbc67894456359ebe649
28+
WFEXS_VER=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
2929
mkdir WfExS_docker_build
3030
cd WfExS_docker_build
3131
curl -O https://raw.githubusercontent.com/inab/WfExS-backend/${WFEXS_VER}/container_recipes/Dockerfile
@@ -46,7 +46,7 @@ just using next bash pattern:
4646

4747
```bash
4848
# WFEXS_VER can be either a branch, a tag or a commit hash
49-
WFEXS_VER=574fe343c0b59eecd95afbc67894456359ebe649
49+
WFEXS_VER=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
5050
podman build -t inab/wfexs-backend:${WFEXS_VER} \
5151
--build-arg wfexs_checkout="${WFEXS_VER}" \
5252
https://raw.githubusercontent.com/inab/WfExS-backend/${WFEXS_VER}/container_recipes/Dockerfile
@@ -57,7 +57,7 @@ a local copy of the recipe, and next command line from the project root will hel
5757

5858
```bash
5959
# WFEXS_VER can be either a branch, a tag or a commit hash
60-
WFEXS_VER=574fe343c0b59eecd95afbc67894456359ebe649
60+
WFEXS_VER=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
6161
mkdir WfExS_podman_build
6262
cd WfExS_podman_build
6363
curl -O https://raw.githubusercontent.com/inab/WfExS-backend/${WFEXS_VER}/container_recipes/Dockerfile
@@ -77,7 +77,7 @@ The precondition is having either Apptainer or Singularity properly setup. There
7777

7878
```bash
7979
# WFEXS_VER can be either a branch, a tag or a commit hash
80-
WFEXS_VER=574fe343c0b59eecd95afbc67894456359ebe649
80+
WFEXS_VER=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
8181
mkdir WfExS_SIF_build
8282
cd WfExS_SIF_build
8383
curl -O https://raw.githubusercontent.com/inab/WfExS-backend/${WFEXS_VER}/container_recipes/Singularity.def
@@ -88,7 +88,7 @@ The precondition is having either Apptainer or Singularity properly setup. There
8888

8989
```bash
9090
# WFEXS_VER can be either a branch, a tag or a commit hash
91-
WFEXS_VER=574fe343c0b59eecd95afbc67894456359ebe649
91+
WFEXS_VER=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
9292
singularity build \
9393
--build-arg wfexs_checkout="${WFEXS_VER}" \
9494
wfexs-backend-${WFEXS_VER}.sif container_recipes/Singularity.def
@@ -100,7 +100,7 @@ The precondition is having either Apptainer or Singularity properly setup. There
100100

101101
```bash
102102
# Remember to use the correct tag!!!
103-
WFEXS_VER=574fe343c0b59eecd95afbc67894456359ebe649
103+
WFEXS_VER=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
104104
singularity build wfexs-${WFEXS_VER}.sif docker-daemon://inab/wfexs-backend:${WFEXS_VER}
105105
```
106106

@@ -117,7 +117,7 @@ The precondition is having either Apptainer or Singularity properly setup. There
117117
cd WfExS_SIF_build
118118

119119
# Remember to use the correct tag!!!
120-
WFEXS_VER=574fe343c0b59eecd95afbc67894456359ebe649
120+
WFEXS_VER=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
121121

122122
# Next command should be used if you used podman to build the local image
123123
podman save -o wfexs-backend-${WFEXS_VER}.tar inab/wfexs-backend:${WFEXS_VER}
@@ -200,6 +200,10 @@ There are additional software dependencies beyond core ones. Depending on the lo
200200

201201
* [git](https://git-scm.com/) is used to fetch workflows from git repositories.
202202

203+
* [libmagic.so] dynamic library is needed by [python-magic](https://pypi.org/project/python-magic/) package.
204+
205+
* [dot] command (from [GraphViz](https://graphviz.org)) is needed to generate a graphical representation of workflows on Workflow Run RO-Crate generation.
206+
203207
* [gocryptfs](https://nuetzlich.net/gocryptfs/) can be used for the feature of secure intermediate results. It has been tested since version v2.0-beta2 ([releases](https://github.com/rfjakob/gocryptfs/releases) provide static binaries).
204208

205209
* [java](https://openjdk.java.net/): Needed to run Nextflow. Supported Java versions go from version 8 to any version below 15 (Nextflow does not support this last one). Both OpenJDK and Sun implementations should work.

container_recipes/.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.sif
2+
*.tar
3+
*.tar.*
4+
*.def

container_recipes/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.sif
2+
*.tar
3+
*.tar.*

container_recipes/Dockerfile

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1+
FROM gcc:13 AS entr_build
2+
ARG suid_entrypoint_checkout=adf2da44acf4a5feec10b8c73660e8a9b6a4a03b
3+
WORKDIR /
4+
# hadolint ignore=DL3003
5+
RUN git clone --filter=blob:none --no-checkout https://github.com/jmfernandez/suid_entrypoint.git && \
6+
cd suid_entrypoint && \
7+
git checkout "$suid_entrypoint_checkout" && \
8+
gcc -static -o suid_entrypoint suid_entrypoint.c
9+
110
# The default images of python are based on debian
211
FROM python:3.12
312
# These arguments help customizing what it is included in the generated image
4-
ARG wfexs_checkout=574fe343c0b59eecd95afbc67894456359ebe649
5-
ARG apptainer_version=1.3.2
13+
ARG wfexs_checkout=8a0a980f1a5e69064d16f89f8ec31973b2eb0c8b
14+
ARG apptainer_version=1.3.3
615
# JDK version parameters
716
ARG JDK_MAJOR_VER=11
817
ARG JDK_VER=${JDK_MAJOR_VER}.0.11
@@ -16,7 +25,9 @@ ARG GOCRYPTFS_VER=v2.4.0
1625
ARG STATIC_BASH_VER=5.1.004-1.2.2
1726
# static busybox version
1827
ARG BUSYBOX_VER=1.35.0
28+
COPY --from=entr_build /suid_entrypoint/suid_entrypoint /suid_entrypoint
1929
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
30+
RUN chmod u+s /suid_entrypoint
2031
# Install apptainer
2132
RUN DPKG_ARCH=$(dpkg --print-architecture) && \
2233
wget -nv \
@@ -35,9 +46,9 @@ RUN wget -nv -O /etc/apt/keyrings/docker.asc https://download.docker.com/linux/d
3546
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
3647
apt-get update && \
3748
apt-get install -y --no-install-recommends docker-ce-cli
38-
# Install both podman and encfs
49+
# Install both podman, encfs and graphviz
3950
# hadolint ignore=DL3008
40-
RUN apt-get install -y podman encfs
51+
RUN apt-get install -y podman encfs graphviz
4152
# Install WfExS, trusting the installers in the commit rather than the
4253
# one in the docker recipe
4354
WORKDIR /
@@ -64,4 +75,5 @@ RUN JDK_MAJOR_VER="${JDK_MAJOR_VER}" \
6475
STATIC_BASH_VER="${STATIC_BASH_VER}" \
6576
BUSYBOX_VER="${BUSYBOX_VER}" \
6677
bash /full-installer.bash
78+
ENTRYPOINT [ "/suid_entrypoint" ]
6779
CMD ["bash"]

container_recipes/Singularity.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
4343
tee /etc/apt/sources.list.d/docker.list > /dev/null && \
4444
apt-get update && \
4545
apt-get install -y --no-install-recommends docker-ce-cli
46-
# Install both podman and encfs
46+
# Install both podman, encfs and graphviz
4747
# hadolint ignore=DL3008
48-
apt-get install -y podman encfs
48+
apt-get install -y podman encfs graphviz
4949
# Install WfExS, trusting the installers in the commit rather than the
5050
# one in the docker recipe
5151
mkdir -p /

container_recipes/basic-installer.bash

Lines changed: 96 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# limitations under the License.
1717

1818
# Getting the installation directory
19-
scriptDir="$(dirname "$0")"
19+
scriptDir="$(dirname "$(readlink -f "$0")")"
2020
case "${scriptDir}" in
2121
/*)
2222
# Path is absolute
@@ -90,7 +90,7 @@ checkInstallGO() {
9090
fi
9191
}
9292

93-
for cmd in python3 pip ; do
93+
for cmd in python3 ; do
9494
set +e
9595
type -a "$cmd" 2> /dev/null
9696
retval=$?
@@ -101,6 +101,21 @@ for cmd in python3 pip ; do
101101
fi
102102
done
103103

104+
for cmd in dot ; do
105+
set +e
106+
type -a "$cmd" 2> /dev/null
107+
retval=$?
108+
set -e
109+
if [ "$retval" -ne 0 ] ; then
110+
failed=1
111+
echo "ERROR: Command $cmd not found in PATH and needed by WfExS runtime"
112+
fi
113+
done
114+
115+
if [ -n "$failed" ] ; then
116+
exit 1
117+
fi
118+
104119
failed=
105120
for lib in libmagic.so ; do
106121
set +e
@@ -109,7 +124,7 @@ for lib in libmagic.so ; do
109124
set -e
110125
if [ "$retval" -ne 0 ] ; then
111126
failed=1
112-
echo "ERROR: Library $lib found in ldconfig cache and needed for the installation"
127+
echo "ERROR: Library $lib found in ldconfig cache and needed by WfExS runtime"
113128
fi
114129
done
115130

@@ -126,7 +141,49 @@ fi
126141

127142
# Is WfExS already installed??? (case of Docker)
128143
set +eu
129-
python3 -P -c "import sys"$'\n'"try:"$'\n'" import wfexs_backend"$'\n'"except:"$'\n'" sys.exit(1)"$'\n'"sys.exit(0)"
144+
python3 --help | grep -q '^-P '
145+
retval=$?
146+
if [ "$retval" -eq 0 ] ; then
147+
python_p_flag="-P"
148+
read -r -d "" CHECKWFEXS <<EOF
149+
import sys
150+
151+
try:
152+
import wfexs_backend
153+
except:
154+
sys.exit(1)
155+
156+
sys.exit(0)
157+
EOF
158+
python3 -P -c "$CHECKWFEXS"
159+
retval=$?
160+
else
161+
python_p_flag=""
162+
read -r -d "" CHECKWFEXS <<EOF
163+
import sys
164+
165+
try:
166+
# Let's remove current directory
167+
sys.path.remove("")
168+
except:
169+
pass
170+
171+
try:
172+
import os
173+
# Let's remove current directory
174+
sys.path.remove(os.getcwd())
175+
except:
176+
pass
177+
178+
try:
179+
import wfexs_backend
180+
except:
181+
sys.exit(1)
182+
183+
sys.exit(0)
184+
EOF
185+
fi
186+
python3 $python_p_flag -c "$CHECKWFEXS"
130187
retval=$?
131188
set -eu
132189
if [ "$retval" -eq 0 ] ; then
@@ -161,12 +218,45 @@ if [ -z "$envDir" ]; then
161218
# Activating the python environment
162219
envActivate="${envDir}/bin/activate"
163220
source "${envActivate}"
221+
222+
# Pip should be available
223+
for cmd in pip ; do
224+
set +e
225+
type -a "$cmd" 2> /dev/null
226+
retval=$?
227+
set -e
228+
if [ "$retval" -ne 0 ] ; then
229+
failed=1
230+
echo "ERROR: Command $cmd not found in PATH and needed for the installation"
231+
exit 1
232+
fi
233+
done
234+
164235
pip install --require-virtualenv --upgrade pip wheel
165236
fi
166237

238+
# Pip should be available
239+
for cmd in pip ; do
240+
set +e
241+
type -a "$cmd" 2> /dev/null
242+
retval=$?
243+
set -e
244+
if [ "$retval" -ne 0 ] ; then
245+
failed=1
246+
echo "ERROR: Command $cmd not found in PATH and needed for the installation"
247+
exit 1
248+
fi
249+
done
250+
167251
# Checking whether the modules were already installed
168-
echo "Installing WfExS-backend python dependencies"
169-
pip install --require-virtualenv -r "${requirementsFile}"
252+
PYVER=$(python -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')
253+
constraintsFile="$(readlink -f "${scriptDir}"/../constraints-${PYVER}.txt)"
254+
echo "Installing WfExS-backend python dependencies (${PYVER})"
255+
PIP_INSTALL_PARAMS=( -r "${requirementsFile}" )
256+
if [ -f "$constraintsFile" ] ; then
257+
PIP_INSTALL_PARAMS+=( -c "${constraintsFile}" )
258+
fi
259+
pip install --require-virtualenv "${PIP_INSTALL_PARAMS[@]}"
170260

171261
# Now, should we run something wrapped?
172262
if [ $# != 0 ] ; then

container_recipes/full-installer.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
: ${BUSYBOX_VER:=1.35.0}
2929

3030
# Getting the installation directory
31-
scriptDir="$(dirname "$0")"
31+
scriptDir="$(dirname "$(readlink -f "$0")")"
3232
case "${scriptDir}" in
3333
/*)
3434
# Path is absolute

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"Programming Language :: Python :: 3.9",
8282
"Programming Language :: Python :: 3.10",
8383
"Programming Language :: Python :: 3.11",
84+
"Programming Language :: Python :: 3.12",
8485
"Development Status :: 3 - Alpha",
8586
"License :: OSI Approved :: Apache Software License",
8687
"Operating System :: OS Independent",

tests/conftest.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@
1717
# limitations under the License.
1818

1919
import pytest
20+
import pathlib
2021

2122
from tests.pushers.marks import (
2223
MARKERS,
2324
)
2425

26+
from typing import TYPE_CHECKING
27+
28+
if TYPE_CHECKING:
29+
from py.path.local import LocalPath # type: ignore[import]
30+
2531

2632
def pytest_addoption(parser: "pytest.Parser") -> "None":
2733
for mark_details in MARKERS:
@@ -31,3 +37,8 @@ def pytest_addoption(parser: "pytest.Parser") -> "None":
3137
action="store",
3238
help=mark_details.param_description,
3339
)
40+
41+
42+
@pytest.fixture
43+
def tmppath(tmpdir: "LocalPath") -> "pathlib.Path":
44+
return pathlib.Path(tmpdir)

0 commit comments

Comments
 (0)