Skip to content

Commit 647e9f2

Browse files
authored
Nits and stuff (#3514)
* Remove unused CONF_PATH definition from Server container build * Correct docstring * Correct import of urllib3 package and add requirement for it * Add defaults to deploy-dependencies script * Try to report errors in the containerized Agent command invocation * Remove unused definitions from load_keycloak.sh
1 parent 8db79f5 commit 647e9f2

File tree

7 files changed

+20
-7
lines changed

7 files changed

+20
-7
lines changed

agent/containers/images/container_entrypoint

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,16 @@
88

99
source /opt/pbench-agent/profile
1010

11+
if [[ -z "${*}" ]]; then
12+
echo "No command supplied" >&2
13+
exit 127
14+
fi
15+
16+
# If the exec is successful, control won't return to this script, so the
17+
# commands following it are only for reporting the error (so disable the
18+
# lint check).
19+
# shellcheck disable=SC2093
1120
exec "${@}"
21+
rc=${?}
22+
echo "exec ${*} failed with status ${rc}" >&2
23+
exit ${rc}

lib/pbench/server/auth/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import jwt
99
import requests
1010
from requests.adapters import HTTPAdapter
11-
from requests.packages.urllib3.util.retry import Retry
1211
from requests.structures import CaseInsensitiveDict
12+
from urllib3 import Retry
1313

1414
from pbench.server import JSON, PbenchServerConfig
1515

lib/pbench/test/unit/server/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ def generate_api_key(
10161016
10171017
Args:
10181018
username: username to include in the token payload.
1019-
name: name or description of the key.
1019+
label: name or description of the key.
10201020
user: user attributes will be extracted from the user object to include
10211021
in the token payload.
10221022
offset: If True, 10 min will be added to 'current_utc',to avoid duplicate error

server/pbenchinacan/container-build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ PBINC_INACAN=${PBINC_SERVER}/pbenchinacan
2424
# Locations inside the container
2525
INSTALL_ROOT=/opt/pbench-server
2626
SERVER_LIB=${INSTALL_ROOT}/lib
27-
CONF_PATH=${SERVER_LIB}/config/pbench-server.cfg
2827

2928
#+
3029
# Configuration verification section.

server/pbenchinacan/deploy-dependencies

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,13 @@
1515
# 8090 - keycloak authentication server
1616
# 9200 - Elasticsearch
1717

18+
TMP_DIR=${TMP_DIR:-${WORKSPACE_TMP:-/var/tmp/pbench}}
19+
PB_DEPLOY_FILES=${PB_DEPLOY_FILES:-${TMP_DIR}/pbench_server_deployment}
20+
1821
# The default container registry to use with the organization name in that
1922
# registry. E.g., `quay.io/pbench`.
2023
PB_CONTAINER_REG=${PB_CONTAINER_REG:-$(<${HOME}/.config/pbench/ci_registry.name)}
24+
PB_SERVER_IMAGE_TAG=${PB_SERVER_IMAGE_TAG:-${USER}}
2125

2226
# Default pull policy for all images is to pull the image if the registry has a
2327
# *different* version (despite the name -- different is assumed to be "newer").

server/pbenchinacan/load_keycloak.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ ADMIN_PASSWORD=${ADMIN_PASSWORD:-"admin"}
2929
REALM=${KEYCLOAK_REALM:-"pbench-server"}
3030
CLIENT=${KEYCLOAK_CLIENT:-"pbench-client"}
3131

32-
TMP_DIR=${TMP_DIR:-${WORKSPACE_TMP:-/var/tmp/pbench}}
33-
PB_DEPLOY_FILES=${PB_DEPLOY_FILES:-${TMP_DIR}/pbench_server_deployment}
34-
3532
export CURL_CA_BUNDLE=${CURL_CA_BUNDLE:-"${PWD}/server/pbenchinacan/etc/pki/tls/certs/pbench_CA.crt"}
3633

3734
end_in_epoch_secs=$(date --date "2 minutes" +%s)

server/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ python-dateutil
2020
requests # TODO CVE-2023-32681 (>=2.31.0)
2121
sdnotify
2222
sqlalchemy>=1.4.23
23-
sqlalchemy_utils>=0.37.6
23+
sqlalchemy_utils>=0.37.6
24+
urllib3

0 commit comments

Comments
 (0)