Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ssa/workspaces
1 result
Show changes
Commits on Source (99)
Showing
with 581 additions and 1782 deletions
# Infrastructure Related
BASE_REGISTRY_URL="brooks.aoc.nrao.edu:5000/ssa-docker/workspaces" # the url for the project's docker registry
BASE_IMAGE_TAG=prod # TODO: remove once cache image removed
CACHE_IMAGE_TAG=prod # TODO: remove once cache image removed
ENV=prod # the default environment to build for (one of: dev, test, local, prod)
TAG=prod # the tag name to pull images from when building
ENV_HOST="ws.nrao.edu"
BASE_REGISTRY_URL="ssa-containers.aoc.nrao.edu:5000/ssa-docker/workspaces" # the url for the project's docker registry
BASE_IMAGE_TAG=local # TODO: remove once cache image removed
CACHE_IMAGE_TAG=local # TODO: remove once cache image removed
DEPLOY_ENV=local # the default environment to build for (one of: dev, test, local, prod)
ENV=local # the default environment to build for (one of: dev, test, local, prod)
TAG=local # the tag name to pull images from when building
ENV_HOST="localhost"
DL_HOST="https://dl-dsoc.nrao.edu"
NG_APP_WS_VERSION=${ENV}
WS_VERSION=unknown-version
LOCAL_OR_SERVER_PEX=server-pex # determines if pexes arebuilt from scratch or pulled from the registry (one of: local-pex, server-pex)
LOCAL_OR_SERVER_PEX=local-pex # determines if pexes are built from scratch or pulled from the registry (one of: local-pex, server-pex)
# CAPO Environment Properties
CAPO_PATH=/home/casa/capo
CAPO_PROFILE=dsoc-prod
\ No newline at end of file
CAPO_PROFILE=docker
......@@ -429,19 +429,36 @@ go child pipeline:
DEPLOY_ENV: "prod"
# Development
.deploy:
deploy:
stage: deploy
script:
# Docker doesn't allow variable interpolation when declaring Docker Secret names
# This sed command finds and replaces "dsoc_ENV_secrets:" with "dsoc_${DEPLOY_ENV}_secrets:"
- sed -i "s/dsoc_ENV_secrets:/dsoc_${DEPLOY_ENV}_secrets:/g" docker-compose.yml
- sed -i "s/naasc_ENV_secrets:/naasc_${DEPLOY_ENV}_secrets:/g" docker-compose.yml
- ENV=$DEPLOY_ENV TAG=$IMAGE_TAG DL_HOST=$DL_HOST ENV_HOST=$ENV_HOST docker stack deploy --compose-file docker-compose.yml workspaces-${DEPLOY_ENV} -e TAG=${IMAGE_TAG}
- ENV=$DEPLOY_ENV TAG=$IMAGE_TAG DL_HOST=$DL_HOST ENV_HOST=$ENV_HOST WS_VERSION=$VERSION BASE_REGISTRY_URL=$REGISTRY_URL docker stack deploy --compose-file docker-compose.yml --with-registry-auth workspaces-${DEPLOY_ENV}
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9]\.[0-9]|^[0-9]\.[0-9]\.[0-9])-DEVELOPMENT/'
variables:
IMAGE_TAG: ${CI_COMMIT_BRANCH}
- if: '$CI_COMMIT_TAG =~ /^end-of-sprint-[0-9]+/ || $CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+/'
# override DEPLOY_ENV
DEPLOY_ENV: "dev"
# override DL_HOST
DL_HOST: https://dl-nrao.nrao.edu
# override ENV_HOST
ENV_HOST: ws-dev.nrao.edu
VERSION: 0.0.1+$CI_COMMIT_BRANCH
- if: '$CI_COMMIT_TAG =~ /^end-of-sprint-[0-9]+/'
variables:
IMAGE_TAG: $CI_COMMIT_TAG
# override DEPLOY_ENV
DEPLOY_ENV: "test"
# override DL_HOST
DL_HOST: https://dl-dsoc-test.nrao.edu
# override ENV_HOST
ENV_HOST: ws-test.nrao.edu
VERSION: 0.0.2+$CI_COMMIT_TAG
- if: '$CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]+/'
variables:
IMAGE_TAG: $CI_COMMIT_TAG
# override DEPLOY_ENV
......@@ -450,6 +467,7 @@ go child pipeline:
DL_HOST: https://dl-dsoc-test.nrao.edu
# override ENV_HOST
ENV_HOST: ws-test.nrao.edu
VERSION: $CI_COMMIT_TAG
- if: '$CI_COMMIT_TAG =~ /[0-9]+\.[0-9]+\.[0-9]+$/'
variables:
IMAGE_TAG: $CI_COMMIT_TAG
......@@ -459,4 +477,5 @@ go child pipeline:
DL_HOST: https://dl-dsoc.nrao.edu
# override ENV_HOST
ENV_HOST: ws.nrao.edu
VERSION: $CI_COMMIT_TAG
......@@ -23,5 +23,5 @@ pytest-resource-path = "^1.3.0"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[project.scripts]
[tool.poetry.scripts]
deliver = "delivery.delivery:main"
astropy
oracle
jxmlease
lxml
mysqlclient
numpy
pendulum
pika
psycopg2
pycapo
pysftp
python-dateutil
requests
simplejson
sqlalchemy
urllib
This diff is collapsed.
[tool.poetry]
name = "ingest"
version = "2.8.2rc1"
description = "Ingest is the program that ingests data into the archive."
authors = ["DMS SSA <dms-ssa@nrao.edu>"]
license = "GPL3+"
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
jxmlease = "1.0.3"
lxml = "4.6.3"
pika = "1.2.0"
pycapo = "0.3.1"
pysftp = "0.2.9"
python-dateutil = "2.8.2"
requests = "2.26.0"
simplejson = "3.17.3"
urllib3 = "1.26.6"
markupsafe = "2.0.1"
mysqlclient = "2.0.3"
[tool.poetry.group.test.dependencies]
pytest = "^7.3.1"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
......@@ -15,6 +15,9 @@ pycapo = "^0.3.1"
pytest = "^7.3.1"
hypothesis = "^6.75.7"
[tool.poetry.scripts]
wf_inspector = "wf_inspector.inspector:main"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
#
# Copyright (C) 2021 Associated Universities, Inc. Washington DC, USA.
#
# This file is part of NRAO Workspaces.
#
# Workspaces is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Workspaces is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Workspaces. If not, see <https://www.gnu.org/licenses/>.
"""
Testing suite for ws_metrics
"""
import argparse
import logging
import sys
logger = logging.getLogger("test_ws_metrics")
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler(sys.stdout))
args_b = argparse.Namespace(between=["null", "2021-03-30T00:00:00", "2021-03-30T23:59:59"], capability=None)
result_b = 4
args_c = argparse.Namespace(between=None, capability="null")
result_c = 10
args_rd = argparse.Namespace(requestdatasize=["1"], datasize=None)
result_rd = 10
args_d = argparse.Namespace(requestdatasize=None, datasize=["2021-03-30T00:00:00", "2021-03-30T23:59:59"])
result_d = 100
# they're all broken anyway
# def mock_leu(args: argparse.Namespace) -> LifeUniverseEverything:
# with patch("psycopg2.connect") as mock_connect:
# return LifeUniverseEverything(connection=mock_connect, args=args)
# mock_leu_b = mock_leu(args_b)
# mock_leu_c = mock_leu(args_c)
# mock_leu_rd = mock_leu(args_rd)
# mock_leu_d = mock_leu(args_d)
# class TestWSMetrics:
# @pytest.mark.skip("broken by rewrite")
# def test_get_total_cap_executions(self):
# mock_leu_c.conn.cursor.return_value.fetchone.return_value = result_c
# assert args_c.capability == "null"
# value = mock_leu_c.get_total_cap_executions(args_c.capability)
# assert value == result_c
#
# @pytest.mark.skip("broken by rewrite")
# def test_get_total_executions_in_range(self):
# mock_leu_b.conn.cursor.return_value.fetchone.return_value = result_b
# assert args_b.between[0] == "null"
# assert args_b.between[1] == "2021-03-30T00:00:00"
# assert args_b.between[2] == "2021-03-30T23:59:59"
# value = mock_leu_b.get_total_executions_in_range(args_b.between[0], args_b.between[1], args_b.between[2])
# assert value == result_b
#
# @pytest.mark.skip("broken by rewrite")
# def test_get_total_data_volume(self):
# mock_leu_d.conn.cursor.return_value.fetchone.return_value = result_d
# assert args_d.datasize[0] == "2021-03-30T00:00:00"
# assert args_d.datasize[1] == "2021-03-30T23:59:59"
# value = mock_leu_d.get_total_data_volume(args_d.datasize[0], args_d.datasize[1])
# assert value == result_d
#
# @pytest.mark.skip("broken by rewrite")
# def test_get_request_data_volume(self):
# mock_leu_rd.conn.cursor.return_value.fetchone.return_value = result_rd
# assert args_rd.requestdatasize[0] == "1"
# value = mock_leu_rd.get_request_data_volume("1")
# assert value == result_rd
# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand.
# This file is automatically @generated by Poetry 1.5.0 and should not be changed by hand.
[[package]]
name = "colorama"
version = "0.4.6"
description = "Cross-platform colored terminal text."
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
files = [
{file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"},
{file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"},
]
[[package]]
name = "dsnparse"
version = "0.2.0"
description = "parse dsn urls"
category = "main"
optional = false
python-versions = "*"
files = [
{file = "dsnparse-0.2.0.tar.gz", hash = "sha256:86334148ccdbb52911c8828edb6a5f3064cd52b3a7fd4072c391fa3fa7a87031"},
]
[[package]]
name = "exceptiongroup"
version = "1.1.1"
description = "Backport of PEP 654 (exception groups)"
optional = false
python-versions = ">=3.7"
files = [
{file = "exceptiongroup-1.1.1-py3-none-any.whl", hash = "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e"},
{file = "exceptiongroup-1.1.1.tar.gz", hash = "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"},
]
[package.extras]
test = ["pytest (>=6)"]
[[package]]
name = "iniconfig"
version = "2.0.0"
description = "brain-dead simple config-ini parsing"
optional = false
python-versions = ">=3.7"
files = [
{file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"},
{file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"},
]
[[package]]
name = "mysqlclient"
version = "2.1.1"
description = "Python interface to MySQL"
category = "main"
optional = false
python-versions = ">=3.5"
files = [
......@@ -28,11 +62,36 @@ files = [
{file = "mysqlclient-2.1.1.tar.gz", hash = "sha256:828757e419fb11dd6c5ed2576ec92c3efaa93a0f7c39e263586d1ee779c3d782"},
]
[[package]]
name = "packaging"
version = "23.1"
description = "Core utilities for Python packages"
optional = false
python-versions = ">=3.7"
files = [
{file = "packaging-23.1-py3-none-any.whl", hash = "sha256:994793af429502c4ea2ebf6bf664629d07c1a9fe974af92966e4b8d2df7edc61"},
{file = "packaging-23.1.tar.gz", hash = "sha256:a392980d2b6cffa644431898be54b0045151319d1e7ec34f0cfed48767dd334f"},
]
[[package]]
name = "pluggy"
version = "1.2.0"
description = "plugin and hook calling mechanisms for python"
optional = false
python-versions = ">=3.7"
files = [
{file = "pluggy-1.2.0-py3-none-any.whl", hash = "sha256:c2fd55a7d7a3863cba1a013e4e2414658b1d07b6bc57b3919e0c63c9abb99849"},
{file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"},
]
[package.extras]
dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "psycopg2"
version = "2.9.6"
description = "psycopg2 - Python-PostgreSQL Database Adapter"
category = "main"
optional = false
python-versions = ">=3.6"
files = [
......@@ -55,7 +114,6 @@ files = [
name = "pycapo"
version = "0.3.1"
description = "CAPO (CASA, Archive, and Pipeline Options) for Python"
category = "main"
optional = false
python-versions = "*"
files = [
......@@ -67,7 +125,6 @@ files = [
name = "pymysql"
version = "1.0.3"
description = "Pure Python MySQL Driver"
category = "main"
optional = false
python-versions = ">=3.7"
files = [
......@@ -79,7 +136,40 @@ files = [
ed25519 = ["PyNaCl (>=1.4.0)"]
rsa = ["cryptography"]
[[package]]
name = "pytest"
version = "7.3.2"
description = "pytest: simple powerful testing with Python"
optional = false
python-versions = ">=3.7"
files = [
{file = "pytest-7.3.2-py3-none-any.whl", hash = "sha256:cdcbd012c9312258922f8cd3f1b62a6580fdced17db6014896053d47cddf9295"},
{file = "pytest-7.3.2.tar.gz", hash = "sha256:ee990a3cc55ba808b80795a79944756f315c67c12b56abd3ac993a7b8c17030b"},
]
[package.dependencies]
colorama = {version = "*", markers = "sys_platform == \"win32\""}
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
iniconfig = "*"
packaging = "*"
pluggy = ">=0.12,<2.0"
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
[package.extras]
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
[[package]]
name = "tomli"
version = "2.0.1"
description = "A lil' TOML parser"
optional = false
python-versions = ">=3.7"
files = [
{file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
{file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"},
]
[metadata]
lock-version = "2.0"
python-versions = "^3.10"
content-hash = "7b7eb8a2e7cefc30a3e586c81ae66fa06d7eb31b52c6211baadbb4788618604c"
content-hash = "f7e6f600b14601bba133b5fe13b9ba6fe974fc839d1aad575c3d822c66d4b543"
......@@ -9,7 +9,7 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
dsnparse = "^0.2.0"
mysqlclient = "^2.1.1"
mysqlclient = "2.1.1"
psycopg2 = "^2.9.6"
pycapo = "^0.3.1"
pymysql = "^1.0.3"
......
......@@ -9,8 +9,8 @@ readme = "README.md"
[tool.poetry.dependencies]
python = "^3.10"
pendulum = "^2.1.2"
workspaces = "2.8.2rc1"
messaging = "2.8.2rc1"
workspaces = {path="../../../../shared/workspaces"}
messaging = {path="../../../../shared/messaging"}
[tool.poetry.group.test.dependencies]
pytest = "^7.3.1"
......
......@@ -37,6 +37,9 @@ FROM base as base-build
ARG env=dev
ENV ENV=${env}
ARG ENV_HOST
ENV ENV_HOST=${ENV_HOST}
# Requires build-arg WS_VERSION
# Build arg that sets Workspaces Version; defaults to "dev" if no build arg is given
ENV NG_APP_WS_VERSION=${WS_VERSION}
......
......@@ -145,7 +145,9 @@
<app-status-badge [capabilityRequest]="request"></app-status-badge>
</a>
</td>
<td>{{ getExecutionStatusName(request) }}</td>
<td [ngClass]="{'stage1-status': getExecutionStatusName(request) === 'Awaiting QA',
'execution-status': getExecutionStatusName(request) === 'Executing',
'stage2-status': getExecutionStatusName(request) === 'Stage 2 Review'}">{{ getExecutionStatusName(request) }}</td>
<td>{{ getMetadata(request).sdm_id }}</td>
<td>{{ getMetadata(request).bands ? getMetadata(request).bands.split(' ').join(', ') : "" }}</td>
<td>{{ getMetadata(request).array_config }}</td>
......
......@@ -13,6 +13,27 @@
}
}
.execution-status {
background-color: #FFC0CB;
mat-label {
opacity: 1 !important;
}
}
.stage1-status {
background-color: #99FFFF;
mat-label {
opacity: 1 !important;
}
}
.stage2-status {
background-color: #FF7F50;
mat-label {
opacity: 1;
}
}
.mat-select-panel-wrap {
mat-option:last-child:before {
content: 'All (';
......
......@@ -31,6 +31,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary mr-auto" (click)="undoEditChanges()">Revert Changes</button>
<button type="button" class="btn btn-secondary" (click)="modal.close('exit')">Cancel</button>
<button type="button" class="btn btn-primary" mdbBtn (click)="modal.close('save')">Save</button>
<button type="button" class="btn btn-primary" mdbBtn (click)="this.newEditEvent.emit(this.editedData)">Save</button>
<button type="button" class="btn btn-primary" mdbBtn (click)="modal.close('save-and-close')">Save and Close</button>
</div>
</ng-template>
......@@ -51,7 +51,7 @@ export class EditorComponent implements OnInit {
this.toggleEditorOpen()
this.modalService.open(content, { ariaLabelledBy: "modal-title", centered: true, size: "lg" }).result.then(
(result) => {
if (result === "save" && this.editedData) {
if (result === "save-and-close" && this.editedData) {
// "Save" button clicked; emit edited data to parent component
this.newEditEvent.emit(this.editedData)
this.toggleEditorOpen()
......
......@@ -20,14 +20,14 @@ server {
location /workflows {
proxy_pass http://${ENV_HOST}:3456;
proxy_redirect default;
proxy_redirect http://${ENV_HOST}:3456 /workflows;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /notify {
proxy_pass http://${ENV_HOST}:3458;
proxy_redirect default;
proxy_redirect http://${ENV_HOST}:3458 /notify;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
......
......@@ -3,7 +3,7 @@
script:
- echo "Building branch or tag -- ${IMAGE_TAG}"
- NAME="${REGISTRY_URL}/workspaces/${SERVICE_NAME}"
- docker build -t ${NAME}:${IMAGE_TAG} -f ${PATH_PREFIX}${SERVICE_NAME}/Dockerfile . --build-arg DEPLOY_ENV --build-arg WS_VERSION=${VERSION} --build-arg CAPO_PROFILE=prod --target prod
- docker build -t ${NAME}:${IMAGE_TAG} -f ${PATH_PREFIX}${SERVICE_NAME}/Dockerfile . --build-arg DEPLOY_ENV=${DEPLOY_ENV} --build-arg WS_VERSION=${VERSION} --build-arg CAPO_PROFILE=dsoc-${DEPLOY_ENV} --target prod
- echo "TAG=${IMAGE_TAG}" >> build.env
artifacts:
reports:
......