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
Showing
with 70 additions and 43 deletions
...@@ -26,8 +26,6 @@ import argparse ...@@ -26,8 +26,6 @@ import argparse
import logging import logging
import sys import sys
from pycapo import CapoConfig
from ws_metrics.connections import MDDBConnector from ws_metrics.connections import MDDBConnector
from ws_metrics.inquisition import LifeUniverseEverything from ws_metrics.inquisition import LifeUniverseEverything
...@@ -106,15 +104,6 @@ def parser() -> argparse.ArgumentParser: ...@@ -106,15 +104,6 @@ def parser() -> argparse.ArgumentParser:
return parser return parser
def _get_capo_settings():
"""
return all settings for database connection
:return:
"""
return CapoConfig().settings("metadataDatabase")
def main(): def main():
print("**********************************") print("**********************************")
print("* WELCOME TO WORKSPACES METRICS! *") print("* WELCOME TO WORKSPACES METRICS! *")
......
...@@ -118,13 +118,13 @@ ...@@ -118,13 +118,13 @@
</button> </button>
</th> </th>
<th>Current Processing Start Time</th> <th>Current Processing Start Time</th>
<th *ngIf="capability.requires_qa"> <th *ngIf="capability && capability.requires_qa">
Stage 1 Reviewer Stage 1 Reviewer
<button class="btn bg-transparent border-0 btn-light btn-sm" (click)="toggleFilterMenu()"> <button class="btn bg-transparent border-0 btn-light btn-sm" (click)="toggleFilterMenu()">
<span><i class="text-dark small fas fa-filter"></i></span> <span><i class="text-dark small fas fa-filter"></i></span>
</button> </button>
</th> </th>
<th *ngIf="capability.requires_qa"> <th *ngIf="capability && capability.requires_qa">
Stage 2 Reviewer Stage 2 Reviewer
<button class="btn bg-transparent border-0 btn-light btn-sm" (click)="toggleFilterMenu()"> <button class="btn bg-transparent border-0 btn-light btn-sm" (click)="toggleFilterMenu()">
<span><i class="text-dark small fas fa-filter"></i></span> <span><i class="text-dark small fas fa-filter"></i></span>
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
> >
Processing has not started Processing has not started
</td> </td>
<td *ngIf="capability.requires_qa" <td *ngIf="capability && capability.requires_qa"
[ngClass]="{ [ngClass]="{
'staff-assigned' : request.stage_1_reviewer, 'staff-assigned' : request.stage_1_reviewer,
'staff-unassigned' : !request.stage_1_reviewer 'staff-unassigned' : !request.stage_1_reviewer
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
</span> </span>
</td> </td>
<!-- for non-srdp entries, DAs want AOD color highlighting to match the DA one --> <!-- for non-srdp entries, DAs want AOD color highlighting to match the DA one -->
<td *ngIf="capability.requires_qa" <td *ngIf="capability && capability.requires_qa"
[ngClass]="{ [ngClass]="{
'staff-assigned' : (getMetadata(request).is_srdp && request.stage_2_reviewer) || (!getMetadata(request).is_srdp && request.stage_1_reviewer), 'staff-assigned' : (getMetadata(request).is_srdp && request.stage_2_reviewer) || (!getMetadata(request).is_srdp && request.stage_1_reviewer),
'staff-unassigned' : (getMetadata(request).is_srdp && !request.stage_2_reviewer) || (!getMetadata(request).is_srdp && !request.stage_1_reviewer) 'staff-unassigned' : (getMetadata(request).is_srdp && !request.stage_2_reviewer) || (!getMetadata(request).is_srdp && !request.stage_1_reviewer)
......
...@@ -13,14 +13,16 @@ ...@@ -13,14 +13,16 @@
} }
} }
mat-option:last-child:before { .mat-select-panel-wrap {
content: 'All ('; mat-option:last-child:before {
} content: 'All (';
}
mat-option:last-child:after { mat-option:last-child:after {
content: ')'; content: ')';
} }
mat-option:last-child .mat-option-text { mat-option:last-child .mat-option-text {
flex-grow: 0; flex-grow: 0;
}
} }
...@@ -171,7 +171,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy { ...@@ -171,7 +171,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
pageStop: number; pageStop: number;
pageAllVal: number; pageAllVal: number;
getPageSizeOptions(): number[] { getPageSizeOptions(): number[] {
const pageSizes = [5, 10, 20, 40]; const pageSizes = [20, 40];
const pageSizeOptions = [this.pageAllVal]; const pageSizeOptions = [this.pageAllVal];
pageSizes.forEach((size) => { pageSizes.forEach((size) => {
...@@ -278,12 +278,10 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy { ...@@ -278,12 +278,10 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
// Get autocomplete suggestion list // Get autocomplete suggestion list
this.filteredStage2QaStaff = this.stage2QaControl.valueChanges.pipe( this.filteredStage2QaStaff = this.stage2QaControl.valueChanges.pipe(
startWith(""), startWith(""),
map((value) => (typeof value === "string" ? value : value.user_name)),
map((val) => this.filter(val, "Stage 2")), map((val) => this.filter(val, "Stage 2")),
); );
this.filteredStage1QaStaff = this.stage1QaControl.valueChanges.pipe( this.filteredStage1QaStaff = this.stage1QaControl.valueChanges.pipe(
startWith(""), startWith(""),
map((value) => (typeof value === "string" ? value : value.user_name)),
map((val) => this.filter(val, "Stage 1")), map((val) => this.filter(val, "Stage 1")),
); );
} }
......
<div *ngIf="this.capabilityRequest"> <div *ngIf="this.capabilityRequest">
<header> <header>
<app-request-header [capabilityRequest]="capabilityRequest" [latestVersion]="latestVersion"></app-request-header> <app-request-header [capability]="capability" [capabilityRequest]="capabilityRequest" [latestVersion]="latestVersion"></app-request-header>
</header> </header>
<div class="row" style="justify-content: center" id="sys-msg-container" *ngIf="this.capabilityRequest.system_messages"> <div class="row" style="justify-content: center" id="sys-msg-container" *ngIf="this.capabilityRequest.system_messages">
<div *ngFor="let msg of this.capabilityRequest.system_messages | keyvalue"> <div *ngFor="let msg of this.capabilityRequest.system_messages | keyvalue">
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<app-status-badge <app-status-badge
id="request-status" id="request-status"
class="d-flex p-2" class="d-flex p-2"
[capability]="capability"
[capabilityRequest]="capabilityRequest" [capabilityRequest]="capabilityRequest"
></app-status-badge> ></app-status-badge>
</h5> </h5>
......
...@@ -23,12 +23,14 @@ import { CapabilityVersion } from "../../../../model/capability-version"; ...@@ -23,12 +23,14 @@ import { CapabilityVersion } from "../../../../model/capability-version";
import * as dayjs from 'dayjs'; import * as dayjs from 'dayjs';
import * as relativeTime from 'dayjs/plugin/relativeTime'; import * as relativeTime from 'dayjs/plugin/relativeTime';
import * as localizedFormat from 'dayjs/plugin/localizedFormat'; import * as localizedFormat from 'dayjs/plugin/localizedFormat';
import {Capability} from "../../../../model/capability";
@Component({ @Component({
selector: "app-request-header", selector: "app-request-header",
templateUrl: "./request-header.component.html", templateUrl: "./request-header.component.html",
styleUrls: ["./request-header.component.scss"], styleUrls: ["./request-header.component.scss"],
}) })
export class RequestHeaderComponent implements OnInit { export class RequestHeaderComponent implements OnInit {
@Input() capability: Capability;
@Input() capabilityRequest: CapabilityRequest; @Input() capabilityRequest: CapabilityRequest;
@Input() latestVersion: CapabilityVersion; @Input() latestVersion: CapabilityVersion;
createdAt; createdAt;
...@@ -74,10 +76,10 @@ export class RequestHeaderComponent implements OnInit { ...@@ -74,10 +76,10 @@ export class RequestHeaderComponent implements OnInit {
isCancellable(): boolean { isCancellable(): boolean {
return !( return !(
this.latestVersion && ( this.latestVersion && (
this.latestVersion.state != 'Cancelled' && this.latestVersion.state !== 'Cancelled' &&
this.latestVersion.state != 'Complete' && this.latestVersion.state !== 'Complete' &&
this.latestVersion.state != 'Failed' && this.latestVersion.state !== 'Failed' &&
this.latestVersion.state != 'Error' this.latestVersion.state !== 'Error'
) )
) )
} }
......
...@@ -152,14 +152,15 @@ export class RequestOperationsComponent implements OnInit { ...@@ -152,14 +152,15 @@ export class RequestOperationsComponent implements OnInit {
} }
/** /**
* The request is closable if it's failed in an error state. * The request is closable if it's failed or in an error state.
*/ */
isRequestCloseable(): boolean { isRequestCloseable(): boolean {
return ( return (
this.selectedVersion && this.selectedVersion &&
this.selectedVersion.state === 'Error' && (this.selectedVersion.state === 'Error' || this.selectedVersion.state === 'Failed') &&
this.selectedVersion.current_execution.state_name === 'Error' (this.selectedVersion.current_execution.state_name === 'Error' || this.selectedVersion.current_execution.state_name === 'Failed')
) && !this.capabilityRequest.sealed
);
} }
public loadDefaultCC() { public loadDefaultCC() {
......
...@@ -28,3 +28,10 @@ ...@@ -28,3 +28,10 @@
*ngIf="capabilityRequest.state === 'Cancelled'" *ngIf="capabilityRequest.state === 'Cancelled'"
><span id="request-status-badge-txt-cancelled">{{ capabilityRequest.state.toUpperCase() }}</span> ><span id="request-status-badge-txt-cancelled">{{ capabilityRequest.state.toUpperCase() }}</span>
</span> </span>
&nbsp;&nbsp;&nbsp;
<span
id="request-sealed-badge"
class="badge badge-pill badge-danger py-2"
*ngIf="capabilityRequest.sealed === true && capabilityRequest.state !== 'Complete' && capability.state_machine !== 'simple'"
><span id="request-sealed-badge-txt">SEALED</span>
</span>
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
import { Component, Input, OnInit } from "@angular/core"; import { Component, Input, OnInit } from "@angular/core";
import { CapabilityRequest } from "../../../../model/capability-request"; import { CapabilityRequest } from "../../../../model/capability-request";
import {Capability} from "../../../../model/capability";
@Component({ @Component({
selector: "app-status-badge", selector: "app-status-badge",
...@@ -25,6 +26,7 @@ import { CapabilityRequest } from "../../../../model/capability-request"; ...@@ -25,6 +26,7 @@ import { CapabilityRequest } from "../../../../model/capability-request";
styleUrls: ["./status-badge.component.scss"], styleUrls: ["./status-badge.component.scss"],
}) })
export class StatusBadgeComponent implements OnInit { export class StatusBadgeComponent implements OnInit {
@Input() capability: Capability;
@Input() capabilityRequest: CapabilityRequest; @Input() capabilityRequest: CapabilityRequest;
constructor() {} constructor() {}
......
...@@ -41,7 +41,7 @@ do ...@@ -41,7 +41,7 @@ do
cd "$module" cd "$module"
# Run the build # Run the build
CGO_ENABLED=0 go build -a -ldflags "-w -s" -o $BUILD_DIR/$module CGO_ENABLED=0 go build -a -buildvcs=false -ldflags "-w -s" -o $BUILD_DIR/$module
cd .. cd ..
done done
...@@ -109,7 +109,7 @@ def main(argv): ...@@ -109,7 +109,7 @@ def main(argv):
# Get list of files that have changed from commit SHA # Get list of files that have changed from commit SHA
# git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA # git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA
sp = subprocess.run( sp = subprocess.run(
["git", "diff-tree", "--no-commit-id", "--name-only", "-r", f"{commit_sha}"], ["git", "diff-tree", "-m", "--no-commit-id", "--name-only", "-r", f"{commit_sha}"],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
universal_newlines=True, universal_newlines=True,
) )
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
.push: .push:
script: script:
- echo "$HARBOR_PASSWORD" | docker login -u "$HARBOR_USER" --password-stdin $REGISTRY_URL - echo "$HARBOR_PASSWORD" | docker login -u "$HARBOR_USER" --password-stdin $REGISTRY_URL
- NAME="${$REGISTRY_URL}/workspaces/${SERVICE_NAME}" - NAME="${REGISTRY_URL}/workspaces/${SERVICE_NAME}"
- docker push ${NAME}:${IMAGE_TAG} - docker push ${NAME}:${IMAGE_TAG}
rules: rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9]\.[0-9]|^[0-9]\.[0-9]\.[0-9])-DEVELOPMENT/' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9]\.[0-9]|^[0-9]\.[0-9]\.[0-9])-DEVELOPMENT/'
......
.unit-test: .unit-test:
image: ${REGISTRY_URL}/${SERVICE_NAME}:${IMAGE_TAG} image: ${REGISTRY_URL}/workspaces/${SERVICE_NAME}:${IMAGE_TAG}
script: script:
- ls -la - ls -la
- pip3 install --upgrade pip - pip3 install --upgrade pip
......
...@@ -2,7 +2,7 @@ FROM golang:1.18.0-alpine3.15 ...@@ -2,7 +2,7 @@ FROM golang:1.18.0-alpine3.15
USER root USER root
RUN apk add python3 py3-pip && pip install watchdog RUN apk add python3 py3-pip git && pip install watchdog
WORKDIR /config WORKDIR /config
......
...@@ -31,7 +31,8 @@ do ...@@ -31,7 +31,8 @@ do
cd "$mod" cd "$mod"
# Run the build # Run the build
CGO_ENABLED=0 go build -a -ldflags "-w -s" -o $BUILD_DIR/$module # go generate
CGO_ENABLED=0 go build -a -buildvcs=false -ldflags "-w -s" -o $BUILD_DIR/$module
cd .. cd ..
done done
...@@ -20,9 +20,20 @@ COPY docker.properties /home/casa/capo/docker.properties ...@@ -20,9 +20,20 @@ COPY docker.properties /home/casa/capo/docker.properties
ENV CAPO_PROFILE "docker" ENV CAPO_PROFILE "docker"
RUN git clone --depth=1 https://gitlab.nrao.edu/krowe/condor_transfer_plugin.git \ # Add gitlab as a known SSH host
RUN mkdir -p ~/.ssh && \
chmod 0700 ~/.ssh && \
ssh-keyscan gitlab.nrao.edu > ~/.ssh/known_hosts
# Link to the host's SSH key and clone over SSH (non-public repo)
RUN --mount=type=secret,id=host_ssh_key,required \
ln -s /run/secrets/host_ssh_key ~/.ssh/id_rsa \
&& git clone --depth=1 gitlab@gitlab.nrao.edu:scg/condor_transfer_plugin.git \
&& cp condor_transfer_plugin/nraorsync_plugin.py /usr/libexec/condor/ && cp condor_transfer_plugin/nraorsync_plugin.py /usr/libexec/condor/
# Remove SSH stuff
RUN rm -rf ~/.ssh/
# Apply config within the container # Apply config within the container
RUN ./update-config RUN ./update-config
RUN /root/bin/boot-execute.sh RUN /root/bin/boot-execute.sh
......
...@@ -56,6 +56,8 @@ services: ...@@ -56,6 +56,8 @@ services:
build: build:
context: . context: .
dockerfile: ./config/htcondor/execute/Dockerfile.local dockerfile: ./config/htcondor/execute/Dockerfile.local
secrets:
- host_ssh_key # Needed to clone a repo from gitlab, will be mounted during the build
volumes: volumes:
- ./delivery_root:/tmp/delivery_root - ./delivery_root:/tmp/delivery_root
- ./lustre/aoc/cluster/pipeline/docker/workspaces:/lustre/aoc/cluster/pipeline/docker/workspaces - ./lustre/aoc/cluster/pipeline/docker/workspaces:/lustre/aoc/cluster/pipeline/docker/workspaces
...@@ -266,3 +268,8 @@ services: ...@@ -266,3 +268,8 @@ services:
volumes: volumes:
condor: condor:
# Store the host's SSH key as a secret to have it removed after building the container, note only RSA for now
secrets:
host_ssh_key:
file: ~/.ssh/id_rsa
...@@ -24,7 +24,7 @@ edu.nrao.workspaces.CapabilitySettings.externalServiceUrl = http://capability:34 ...@@ -24,7 +24,7 @@ edu.nrao.workspaces.CapabilitySettings.externalServiceUrl = http://capability:34
edu.nrao.workspaces.ProcessingSettings.useCasa = false edu.nrao.workspaces.ProcessingSettings.useCasa = false
edu.nrao.workspaces.ProcessingSettings.rootDirectory = /lustre/aoc/cluster/pipeline/docker/workspaces/spool edu.nrao.workspaces.ProcessingSettings.rootDirectory = /lustre/aoc/cluster/pipeline/docker/workspaces/spool
edu.nrao.workspaces.ProcessingSettings.scriptLocation = /lustre/aoc/cluster/pipeline/docker/workspaces/sbin edu.nrao.workspaces.ProcessingSettings.scriptLocation = /lustre/aoc/cluster/pipeline/docker/workspaces/sbin
edu.nrao.workspaces.ProcessingSettings.ramInGb = 0.2G edu.nrao.workspaces.ProcessingSettings.ramInGb = 0.21G
edu.nrao.workspaces.ProcessingSettings.CasaVersion.vlass = /home/casa/packages/pipeline/casa-6.1.3-3-pipeline-2021.1.1.32 edu.nrao.workspaces.ProcessingSettings.CasaVersion.vlass = /home/casa/packages/pipeline/casa-6.1.3-3-pipeline-2021.1.1.32
edu.nrao.archive.workflow.config.CasaVersions.homeForReprocessing = /home/casa/packages/pipeline/current edu.nrao.archive.workflow.config.CasaVersions.homeForReprocessing = /home/casa/packages/pipeline/current
......
...@@ -227,6 +227,12 @@ def close_capability_request(request: Request) -> Response: ...@@ -227,6 +227,12 @@ def close_capability_request(request: Request) -> Response:
if capability_request: if capability_request:
if capability_request.state == "Failed": if capability_request.state == "Failed":
capability_request.update_sealed(True) capability_request.update_sealed(True)
try:
request.capability_info.save_entity(capability_request)
except Exception as exc:
detail = f"sealing of {capability_request.id} failed: {exc}"
return HTTPBadRequest(detail=detail)
return Response(body=f"Capability request with ID {request_id} successfully closed.") return Response(body=f"Capability request with ID {request_id} successfully closed.")
else: else:
not_failed_msg = f"Capability with ID {request_id} is not in a failed state and cannot be closed." not_failed_msg = f"Capability with ID {request_id} is not in a failed state and cannot be closed."
......