[arvados] created: 2.7.0-5672-gc11ae3f057
git repository hosting
git at public.arvados.org
Thu Jan 4 15:47:38 UTC 2024
at c11ae3f057030bf247be90a6cdec06847c889f13 (commit)
commit c11ae3f057030bf247be90a6cdec06847c889f13
Author: Brett Smith <brett.smith at curii.com>
Date: Thu Jan 4 10:42:02 2024 -0500
20846: Migrate from pkg_resources to importlib in sdk/cwl
Now that we're deprecating Python 3.7, it's easy to rely on importlib
from the stdlib.
Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith at curii.com>
diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index fd3b7a5d16..9fc00c0017 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -10,11 +10,12 @@ from future.utils import viewitems
from builtins import str
import argparse
+import importlib.metadata
+import importlib.resources
import logging
import os
import sys
import re
-import pkg_resources # part of setuptools
from schema_salad.sourceline import SourceLine
import schema_salad.validate as validate
@@ -57,15 +58,12 @@ arvados.log_handler.setFormatter(logging.Formatter(
def versionstring():
"""Print version string of key packages for provenance and debugging."""
-
- arvcwlpkg = pkg_resources.require("arvados-cwl-runner")
- arvpkg = pkg_resources.require("arvados-python-client")
- cwlpkg = pkg_resources.require("cwltool")
-
- return "%s %s, %s %s, %s %s" % (sys.argv[0], arvcwlpkg[0].version,
- "arvados-python-client", arvpkg[0].version,
- "cwltool", cwlpkg[0].version)
-
+ return "{} {}, arvados-python-client {}, cwltool {}".format(
+ sys.argv[0],
+ importlib.metadata.version('arvados-cwl-runner'),
+ importlib.metadata.version('arvados-python-client'),
+ importlib.metadata.version('cwltool'),
+ )
def arg_parser(): # type: () -> argparse.ArgumentParser
parser = argparse.ArgumentParser(
@@ -270,10 +268,8 @@ def add_arv_hints():
cwltool.command_line_tool.ACCEPTLIST_RE = cwltool.command_line_tool.ACCEPTLIST_EN_RELAXED_RE
supported_versions = ["v1.0", "v1.1", "v1.2"]
for s in supported_versions:
- res = pkg_resources.resource_stream(__name__, 'arv-cwl-schema-%s.yml' % s)
- customschema = res.read().decode('utf-8')
+ customschema = importlib.resources.read_text(__name__, f'arv-cwl-schema-{s}.yml', 'utf-8')
use_custom_schema(s, "http://arvados.org/cwl", customschema)
- res.close()
cwltool.process.supportedProcessRequirements.extend([
"http://arvados.org/cwl#RunInSingleContainer",
"http://arvados.org/cwl#OutputDirType",
commit d87a40244424a9ad9120f3c1a805793cfe586436
Author: Brett Smith <brett.smith at curii.com>
Date: Thu Jan 4 09:55:52 2024 -0500
20846: Ensure packages directories and indexes are world-readable
See comments for rationale.
Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith at curii.com>
diff --git a/build/run-build-packages-one-target.sh b/build/run-build-packages-one-target.sh
index 12ed10bcb8..be97ef0d13 100755
--- a/build/run-build-packages-one-target.sh
+++ b/build/run-build-packages-one-target.sh
@@ -137,12 +137,19 @@ while [ $# -gt 0 ]; do
done
set -e
+orig_umask="$(umask)"
if [[ -n "$ARVADOS_BUILDING_VERSION" ]]; then
echo "build version='$ARVADOS_BUILDING_VERSION', package iteration='$ARVADOS_BUILDING_ITERATION'"
fi
if [[ -n "$test_packages" ]]; then
+ # Packages are built world-readable, so package indexes should be too,
+ # especially because since 2022 apt uses an unprivileged user `_apt` to
+ # retrieve everything. Ensure it has permissions to read the packages
+ # when mounted as a volume inside the Docker container.
+ chmod a+rx "$WORKSPACE" "$WORKSPACE/packages" "$WORKSPACE/packages/$TARGET"
+ umask 022
if [[ -n "$(find $WORKSPACE/packages/$TARGET -name '*.rpm')" ]] ; then
CREATEREPO="$(command -v createrepo createrepo_c | tail -n1)"
if [[ -z "$CREATEREPO" ]]; then
@@ -179,6 +186,7 @@ if [[ -n "$test_packages" ]]; then
COMMAND="/jenkins/package-testing/test-packages-$TARGET.sh"
IMAGE="arvados/package-test:$TARGET"
+ umask "$orig_umask"
else
IMAGE="arvados/build:$TARGET"
if [[ "$COMMAND" != "" ]]; then
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list