Skip to content

Commit a0dbdb9

Browse files
d-linkoDavid LinkoBrianSipos
authored
Upgrading deps (#273)
* correctly formating AC with typedef values * code cleanup remove debug prints * updating submodules to latest commits * updating to latest versions * updated python from 3.9 to 3.10 * updated required python to >= 3.9 * Install specific versions of pip and pip-tools for compatibility --------- Co-authored-by: David Linko <david.linko@jhuapl.edu> Co-authored-by: Brian Sipos <brian.sipos@jhuapl.edu>
1 parent 951a854 commit a0dbdb9

File tree

13 files changed

+42
-41
lines changed

13 files changed

+42
-41
lines changed

.github/workflows/anms-core.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.9"
20+
python-version: "3.10"
2121
- name: Install dependencies
2222
run: |
2323
pip3 install deps/dtnma-ace

.github/workflows/aricodec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.9"
20+
python-version: "3.10"
2121
- name: Install dependencies
2222
run: |
2323
pip3 install deps/dtnma-ace

.github/workflows/transcoder.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.9"
20+
python-version: "3.10"
2121
- name: Install flake8
2222
working-directory: transcoder
2323
run: pip3 install flake8

anms-core/anms/shared/manager_checker.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,12 @@ def acknowledge(self, index):
6464
curr_alert = None
6565
with open(self.alert_file, 'r') as f:
6666
alerts = json.load(f)
67-
logger.info(alerts)
68-
logger.info(index)
6967
curr_alert = alerts.get(str(index))
70-
logger.info(curr_alert)
7168
if curr_alert:
7269
logger.info(f"ACK {index}")
7370
curr_alert["visible"]= False
7471
alerts[str(index)] = curr_alert
7572
with open(self.alert_file, 'w') as f:
76-
logger.info(alerts)
7773
json.dump(alerts, f)
7874
except (FileNotFoundError, json.JSONDecodeError):
7975
logger.error("ERROR reading alert.json")

anms-ui/public/app/components/management/builder/ActionParameter.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default {
5252
return {
5353
ariKey: undefined,
5454
ac: [],
55-
result: { index: this.index, type: "AC", value: [] },
55+
result: { index: this.index, type: this.type, value: [] },
5656
keys: [],
5757
currAc: [],
5858
keysRealIndex: [],
@@ -65,14 +65,9 @@ export default {
6565
this.addToList();
6666
},
6767
addToList: function () {
68-
if(this.ac.length >= this.count){
69-
this.ac.pop();
70-
}
71-
7268
if (this.ariKey != null) {
7369
this.ac.push(this.ariKey)
7470
}
75-
7671
this.ariKey = null;
7772
this.createAC();
7873
},

anms-ui/public/app/components/management/builder/ParameterView.vue

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,12 @@ export default {
158158
testResult.push(JSON.stringify(head + value).replaceAll('"', ""));
159159
break;
160160
case "AC": //ac
161-
let curr_str= ""
162-
currValue = [];
161+
let curr_str= ""
162+
currValue = [];
163163
value.forEach((ari) => {
164164
currValue.push(ari);
165165
});
166-
if(currValue.length = 1 ){
167-
testResult.push(currValue[0])
168-
}else{
169-
testResult.push("/AC/("+currValue.join(",")+")");
170-
}
166+
testResult.push("/AC/("+currValue.join(",")+")");
171167
break;
172168
173169
case "EXPR": //ac
@@ -181,11 +177,20 @@ export default {
181177
182178
break;
183179
default:
184-
if (type.includes("TYPEDEF")){
185-
testResult.push(value[0]);
186-
}else{
187-
188-
testResult.push((value));}
180+
if (type.includes("TYPEDEF")){
181+
let curr_str= ""
182+
currValue = [];
183+
value.forEach((ari) => {
184+
currValue.push(ari);
185+
});
186+
if(currValue.length == 1 ){
187+
testResult.push(currValue[0])
188+
}else{
189+
testResult.push("/AC/("+currValue.join(",")+")");
190+
}
191+
}else{
192+
testResult.push((value));
193+
}
189194
190195
break;
191196
}

anms-ui/public/app/components/management/builder/ariBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export default {
212212
index: index,
213213
result: [],
214214
name: name,
215-
type: "TYPEDEF",
215+
type: parm,
216216
listComponents: aris,
217217
count: 1,
218218
},

anms.Containerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,32 +39,34 @@ ENV APP_USER=anms
3939
RUN groupadd -r -g 9999 ${APP_USER} && \
4040
useradd -m -r -g ${APP_USER} -u 9999 ${APP_USER}
4141

42+
4243
# This image includes common libraries used by the aricodec and anms-core
4344
# containers.
4445
# Sets environment:
4546
# PY_WHEEL_DIR to local PIP wheel search path
4647
#
4748
FROM anms-base AS dtnma-acelib
4849

49-
5050
# Install System Level Dependencies
5151
RUN --mount=type=cache,target=/var/cache/yum \
52-
dnf -y install gcc-c++ python-devel python3-pip python3-wheel python3-setuptools iputils && \
53-
pip3 install pip-tools
52+
dnf -y install gcc-c++ python-devel python3-pip python3-wheel python3-setuptools iputils
5453

5554
# Use specific OS python version
5655
ENV PIP=pip3
5756
ENV PYTHON=python3
5857
# Submodules with dependencies
5958
ENV PY_WHEEL_DIR=/usr/local/lib/wheels
6059

61-
RUN ${PIP} install --upgrade pip
60+
RUN --mount=type=cache,target=/root/.cache/pip \
61+
${PIP} install --upgrade 'pip~=24.0' 'pip-tools~=7.5'
6262

6363
COPY deps/dtnma-ace /usr/src/dtnma-ace
64-
RUN ${PIP} -v wheel /usr/src/dtnma-ace -w ${PY_WHEEL_DIR} --no-deps
64+
RUN --mount=type=cache,target=/root/.cache/pip \
65+
${PIP} wheel /usr/src/dtnma-ace -w ${PY_WHEEL_DIR} --no-deps
6566

6667
COPY deps/dtnma-camp /usr/src/dtnma-camp
67-
RUN ${PIP} wheel /usr/src/dtnma-camp -w ${PY_WHEEL_DIR} --no-deps
68+
RUN --mount=type=cache,target=/root/.cache/pip \
69+
${PIP} wheel /usr/src/dtnma-camp -w ${PY_WHEEL_DIR} --no-deps
6870

6971
COPY deps/dtnma-adms /usr/src/dtnma-adms
7072

@@ -189,7 +191,8 @@ ENV APP_WORK_DIR=/opt/app
189191
# Copy over all required content (source, data, etc.)
190192
COPY --chown=${APP_USER}:${APP_USER} transcoder ${APP_WORK_DIR}
191193
# Install all python dependencies
192-
RUN ${PIP} install -r ${APP_WORK_DIR}/requirements.txt
194+
RUN --mount=type=cache,target=/root/.cache/pip \
195+
${PIP} install -r ${APP_WORK_DIR}/requirements.txt
193196

194197
# Tune Final Settings
195198
WORKDIR ${APP_WORK_DIR}
@@ -239,12 +242,14 @@ ENV APP_WORK_DIR=/usr/src/anms-core
239242

240243
# Requirement of main module
241244
COPY anms-core/pyproject.toml ${APP_WORK_DIR}/
242-
RUN cd ${APP_WORK_DIR} && \
245+
RUN --mount=type=cache,target=/root/.cache/pip \
246+
cd ${APP_WORK_DIR} && \
243247
pip-compile --find-links ${PY_WHEEL_DIR} pyproject.toml && \
244248
${PIP} install --ignore-installed -r requirements.txt
245249
# Actual main package
246250
COPY anms-core/anms ${APP_WORK_DIR}/anms
247-
RUN ${PIP} install ${APP_WORK_DIR}
251+
RUN --mount=type=cache,target=/root/.cache/pip \
252+
${PIP} install ${APP_WORK_DIR}
248253

249254
RUN mkdir -p /usr/local/share/ace && \
250255
cp -R /usr/src/dtnma-adms /usr/local/share/ace/adms

aricodec/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ authors = [
1010
description = "ARI CODEC service"
1111
#readme = "README.md"
1212
license = { file="LICENSE" }
13-
requires-python = ">=3.7"
13+
requires-python = ">=3.9"
1414
classifiers = [
1515
"Development Status :: 5 - Production/Stable",
1616
"License :: OSI Approved :: Apache Software License",
@@ -19,7 +19,7 @@ classifiers = [
1919
]
2020

2121
dependencies = [
22-
"dtnma-ace ~=2.0.0",
22+
"dtnma-ace",
2323
"paho-mqtt ~=1.6.1",
2424
"sqlalchemy ~=1.4.42",
2525
"psycopg2-binary ~=2.9.5",

0 commit comments

Comments
 (0)