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
import logging
import sys
from pycapo import CapoConfig
from ws_metrics.connections import MDDBConnector
from ws_metrics.inquisition import LifeUniverseEverything
......@@ -106,15 +104,6 @@ def parser() -> argparse.ArgumentParser:
return parser
def _get_capo_settings():
"""
return all settings for database connection
:return:
"""
return CapoConfig().settings("metadataDatabase")
def main():
print("**********************************")
print("* WELCOME TO WORKSPACES METRICS! *")
......
......@@ -118,13 +118,13 @@
</button>
</th>
<th>Current Processing Start Time</th>
<th *ngIf="capability.requires_qa">
<th *ngIf="capability && capability.requires_qa">
Stage 1 Reviewer
<button class="btn bg-transparent border-0 btn-light btn-sm" (click)="toggleFilterMenu()">
<span><i class="text-dark small fas fa-filter"></i></span>
</button>
</th>
<th *ngIf="capability.requires_qa">
<th *ngIf="capability && capability.requires_qa">
Stage 2 Reviewer
<button class="btn bg-transparent border-0 btn-light btn-sm" (click)="toggleFilterMenu()">
<span><i class="text-dark small fas fa-filter"></i></span>
......@@ -197,7 +197,7 @@
>
Processing has not started
</td>
<td *ngIf="capability.requires_qa"
<td *ngIf="capability && capability.requires_qa"
[ngClass]="{
'staff-assigned' : request.stage_1_reviewer,
'staff-unassigned' : !request.stage_1_reviewer
......@@ -245,7 +245,7 @@
</span>
</td>
<!-- 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]="{
'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)
......
......@@ -13,14 +13,16 @@
}
}
mat-option:last-child:before {
content: 'All (';
}
.mat-select-panel-wrap {
mat-option:last-child:before {
content: 'All (';
}
mat-option:last-child:after {
content: ')';
}
mat-option:last-child:after {
content: ')';
}
mat-option:last-child .mat-option-text {
flex-grow: 0;
mat-option:last-child .mat-option-text {
flex-grow: 0;
}
}
......@@ -171,7 +171,7 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
pageStop: number;
pageAllVal: number;
getPageSizeOptions(): number[] {
const pageSizes = [5, 10, 20, 40];
const pageSizes = [20, 40];
const pageSizeOptions = [this.pageAllVal];
pageSizes.forEach((size) => {
......@@ -278,12 +278,10 @@ export class ActiveCapabilityRequestsComponent implements OnInit, OnDestroy {
// Get autocomplete suggestion list
this.filteredStage2QaStaff = this.stage2QaControl.valueChanges.pipe(
startWith(""),
map((value) => (typeof value === "string" ? value : value.user_name)),
map((val) => this.filter(val, "Stage 2")),
);
this.filteredStage1QaStaff = this.stage1QaControl.valueChanges.pipe(
startWith(""),
map((value) => (typeof value === "string" ? value : value.user_name)),
map((val) => this.filter(val, "Stage 1")),
);
}
......
<div *ngIf="this.capabilityRequest">
<header>
<app-request-header [capabilityRequest]="capabilityRequest" [latestVersion]="latestVersion"></app-request-header>
<app-request-header [capability]="capability" [capabilityRequest]="capabilityRequest" [latestVersion]="latestVersion"></app-request-header>
</header>
<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">
......
......@@ -5,6 +5,7 @@
<app-status-badge
id="request-status"
class="d-flex p-2"
[capability]="capability"
[capabilityRequest]="capabilityRequest"
></app-status-badge>
</h5>
......
......@@ -23,12 +23,14 @@ import { CapabilityVersion } from "../../../../model/capability-version";
import * as dayjs from 'dayjs';
import * as relativeTime from 'dayjs/plugin/relativeTime';
import * as localizedFormat from 'dayjs/plugin/localizedFormat';
import {Capability} from "../../../../model/capability";
@Component({
selector: "app-request-header",
templateUrl: "./request-header.component.html",
styleUrls: ["./request-header.component.scss"],
})
export class RequestHeaderComponent implements OnInit {
@Input() capability: Capability;
@Input() capabilityRequest: CapabilityRequest;
@Input() latestVersion: CapabilityVersion;
createdAt;
......@@ -74,10 +76,10 @@ export class RequestHeaderComponent implements OnInit {
isCancellable(): boolean {
return !(
this.latestVersion && (
this.latestVersion.state != 'Cancelled' &&
this.latestVersion.state != 'Complete' &&
this.latestVersion.state != 'Failed' &&
this.latestVersion.state != 'Error'
this.latestVersion.state !== 'Cancelled' &&
this.latestVersion.state !== 'Complete' &&
this.latestVersion.state !== 'Failed' &&
this.latestVersion.state !== 'Error'
)
)
}
......
......@@ -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 {
return (
this.selectedVersion &&
this.selectedVersion.state === 'Error' &&
this.selectedVersion.current_execution.state_name === 'Error'
)
(this.selectedVersion.state === 'Error' || this.selectedVersion.state === 'Failed') &&
(this.selectedVersion.current_execution.state_name === 'Error' || this.selectedVersion.current_execution.state_name === 'Failed')
&& !this.capabilityRequest.sealed
);
}
public loadDefaultCC() {
......
......@@ -28,3 +28,10 @@
*ngIf="capabilityRequest.state === 'Cancelled'"
><span id="request-status-badge-txt-cancelled">{{ capabilityRequest.state.toUpperCase() }}</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 @@
*/
import { Component, Input, OnInit } from "@angular/core";
import { CapabilityRequest } from "../../../../model/capability-request";
import {Capability} from "../../../../model/capability";
@Component({
selector: "app-status-badge",
......@@ -25,6 +26,7 @@ import { CapabilityRequest } from "../../../../model/capability-request";
styleUrls: ["./status-badge.component.scss"],
})
export class StatusBadgeComponent implements OnInit {
@Input() capability: Capability;
@Input() capabilityRequest: CapabilityRequest;
constructor() {}
......
......@@ -41,7 +41,7 @@ do
cd "$module"
# 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 ..
done
......@@ -109,7 +109,7 @@ def main(argv):
# Get list of files that have changed from commit SHA
# git diff-tree --no-commit-id --name-only -r $CI_COMMIT_SHA
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,
universal_newlines=True,
)
......
......@@ -2,7 +2,7 @@
.push:
script:
- 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}
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_BRANCH =~ /(^[0-9]\.[0-9]|^[0-9]\.[0-9]\.[0-9])-DEVELOPMENT/'
......
.unit-test:
image: ${REGISTRY_URL}/${SERVICE_NAME}:${IMAGE_TAG}
image: ${REGISTRY_URL}/workspaces/${SERVICE_NAME}:${IMAGE_TAG}
script:
- ls -la
- pip3 install --upgrade pip
......
......@@ -2,7 +2,7 @@ FROM golang:1.18.0-alpine3.15
USER root
RUN apk add python3 py3-pip && pip install watchdog
RUN apk add python3 py3-pip git && pip install watchdog
WORKDIR /config
......
......@@ -31,7 +31,8 @@ do
cd "$mod"
# 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 ..
done
......@@ -20,9 +20,20 @@ COPY docker.properties /home/casa/capo/docker.properties
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/
# Remove SSH stuff
RUN rm -rf ~/.ssh/
# Apply config within the container
RUN ./update-config
RUN /root/bin/boot-execute.sh
......
......@@ -56,6 +56,8 @@ services:
build:
context: .
dockerfile: ./config/htcondor/execute/Dockerfile.local
secrets:
- host_ssh_key # Needed to clone a repo from gitlab, will be mounted during the build
volumes:
- ./delivery_root:/tmp/delivery_root
- ./lustre/aoc/cluster/pipeline/docker/workspaces:/lustre/aoc/cluster/pipeline/docker/workspaces
......@@ -266,3 +268,8 @@ services:
volumes:
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
edu.nrao.workspaces.ProcessingSettings.useCasa = false
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.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.archive.workflow.config.CasaVersions.homeForReprocessing = /home/casa/packages/pipeline/current
......
......@@ -227,6 +227,12 @@ def close_capability_request(request: Request) -> Response:
if capability_request:
if capability_request.state == "Failed":
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.")
else:
not_failed_msg = f"Capability with ID {request_id} is not in a failed state and cannot be closed."
......