Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions agent-service/.dockerignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import javax.ws.rs._
import javax.ws.rs.core.MediaType
import scala.jdk.CollectionConverters._
import java.util
import javax.ws.rs.DELETE
import javax.ws.rs.PathParam
import javax.ws.rs.core.Response

object PveResource {
Expand Down
3 changes: 1 addition & 2 deletions bin/licensing/audit_jar_licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,12 @@ def main() -> int:
groups = collect_groups([Path(d) for d in args.lib_dirs])

rows = []
for (lic_h, not_h), members in groups.items():
for (lic_h, _), members in groups.items():
sample_lic = members[0][1]
sample_not = members[0][2]
cprights = len(COPYRIGHT_RE.findall(sample_lic))
rows.append({
"lic_hash": lic_h,
"not_hash": not_h,
"lic_size": len(sample_lic),
"not_size": len(sample_not),
"cprights": cprights,
Expand Down
3 changes: 0 additions & 3 deletions bin/licensing/test_generate_notice_binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def make_jar(
group: str | None = None,
artifact: str | None = None,
version: str | None = None,
extra: dict[str, str] | None = None,
) -> Path:
"""Write a minimal jar (zip) with an optional META-INF/NOTICE and an
optional Maven pom.properties."""
Expand All @@ -59,8 +58,6 @@ def make_jar(
f"META-INF/maven/{group}/{artifact}/pom.properties",
f"#Generated by Maven\ngroupId={group}\nartifactId={artifact}\nversion={version}\n",
)
for name, content in (extra or {}).items():
zf.writestr(name, content)
return path


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ abstract class SQLSourceOpExec(descString: String) extends SourceOperatorExecuto
curLowerBound.longValue <= upperBound.longValue
case AttributeType.DOUBLE =>
curLowerBound.doubleValue <= upperBound.doubleValue
case AttributeType.STRING | AttributeType.ANY | AttributeType.BOOLEAN | _ =>
case _ =>
throw new IllegalArgumentException("Unexpected type: " + attribute.getType)
}
case None =>
Expand Down Expand Up @@ -298,7 +298,7 @@ abstract class SQLSourceOpExec(descString: String) extends SourceOperatorExecuto
case AttributeType.DOUBLE =>
nextLowerBound = curLowerBound.doubleValue + desc.interval
isLastBatch = nextLowerBound.doubleValue >= upperBound.doubleValue
case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _ =>
case _ =>
Comment thread
aglinxinyuan marked this conversation as resolved.
Resolved
throw new IllegalArgumentException("Unexpected type: " + attribute.getType)
}
queryBuilder ++= " AND " + attribute.getName +
Expand Down Expand Up @@ -332,7 +332,7 @@ abstract class SQLSourceOpExec(descString: String) extends SourceOperatorExecuto
String.valueOf(value)
case AttributeType.TIMESTAMP =>
"'" + new Timestamp(value.longValue).toString + "'"
case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _ =>
case _ =>
throw new IllegalArgumentException("Unexpected type: " + attribute.getType)
}
case None =>
Expand Down Expand Up @@ -368,7 +368,7 @@ abstract class SQLSourceOpExec(descString: String) extends SourceOperatorExecuto
resultSet.getTimestamp(1).getTime
case AttributeType.DOUBLE =>
resultSet.getDouble(1)
case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _ =>
case _ =>
throw new IllegalStateException("Unexpected value: " + attribute.getType)
}
resultSet.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class AsterixDBSourceOpExec private[asterixdb] (
String.valueOf(value)
case AttributeType.TIMESTAMP =>
"datetime('" + formatter.format(new Timestamp(value.longValue).toInstant) + "')"
case AttributeType.BOOLEAN | AttributeType.STRING | AttributeType.ANY | _ =>
case _ =>
throw new IllegalArgumentException("Unexpected type: " + attribute.getType)
}
case None =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class ComputingUnitActionsService {

// ng-zorro renders this string as HTML and any user can name their unit, so the name is escaped.
const unitName = escapeHtml(unit.computingUnit.name);
const unitType = unit?.computingUnit.type || "kubernetes"; // fallback
const unitType = unit.computingUnit.type || "kubernetes"; // fallback
const templates = unitTypeMessageTemplate[unitType];

// Show confirmation modal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
getRelativePathFromDatasetFileNode,
} from "../../../../../common/type/datasetVersionFileTree";
import { Contributor, DatasetVersion } from "../../../../../common/type/dataset";
import { switchMap, throttleTime } from "rxjs/operators";
import { switchMap, tap, throttleTime } from "rxjs/operators";
Comment thread
aglinxinyuan marked this conversation as resolved.
Resolved
import { NotificationService } from "../../../../../common/service/notification/notification.service";
import { DownloadService } from "../../../../service/user/download/download.service";
import { formatSize } from "src/app/common/util/size-formatter.util";
Expand Down Expand Up @@ -62,7 +62,7 @@ import { DATASET_FILE_RESOURCE_ENDPOINT } from "../../../../service/user/file-re
import { VersionsFilesBrowserComponent } from "../../versions-files-browser/versions-files-browser.component";
import { ResourceDetailSettingsComponent } from "../../resource-detail-settings.component";

export const THROTTLE_TIME_MS = 1000;
const THROTTLE_TIME_MS = 1000;

@UntilDestroy()
@Component({
Expand Down Expand Up @@ -167,12 +167,11 @@ export class DatasetDetailComponent implements OnInit {
ngOnInit(): void {
this.route.params
.pipe(
switchMap(params => {
tap(params => {
this.did = params["did"];
this.retrieveDatasetInfo();
this.retrieveDatasetVersionList();
this.retrieveLatestVersionFile();
return this.route.data; // or some other observable
}),
Comment thread
aglinxinyuan marked this conversation as resolved.
Resolved
untilDestroyed(this)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { Component, OnInit, ViewChild } from "@angular/core";
import { ActivatedRoute } from "@angular/router";
import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
import { catchError, map, switchMap } from "rxjs/operators";
import { catchError, map, switchMap, tap } from "rxjs/operators";
import { Observable, of } from "rxjs";
import { format } from "date-fns";
import { NgIf, NgClass, NgFor } from "@angular/common";
Expand Down Expand Up @@ -173,19 +173,18 @@ export class ModelDetailComponent implements OnInit {
ngOnInit(): void {
this.route.params
.pipe(
switchMap(params => {
tap(params => {
// Route params are strings, and the segment is whatever the URL carried: reject
// anything that is not a positive integer once, here, rather than at each use.
const mid = Number(params["mid"]);
this.mid = Number.isInteger(mid) && mid > 0 ? mid : undefined;
if (this.mid === undefined) {
this.notificationService.error("This is not a valid model id");
return this.route.data;
return;
}
this.retrieveModelInfo();
this.retrieveModelVersionList();
this.loadHubActivity();
return this.route.data;
}),
untilDestroyed(this)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ import { By } from "@angular/platform-browser";
import { NzModalService } from "ng-zorro-antd/modal";
import { NzTooltipDirective } from "ng-zorro-antd/tooltip";
import { concat, Observable, of, Subject, throwError } from "rxjs";
import {
ABORT_RETRY_BACKOFF_BASE_MS,
ABORT_RETRY_MAX_ATTEMPTS,
VersionUploaderComponent,
} from "./version-uploader.component";
import { VersionUploaderComponent } from "./version-uploader.component";
import {
MultipartUploadProgress,
MultipartUploadService,
Expand Down Expand Up @@ -257,6 +253,10 @@ describe("VersionUploaderComponent", () => {
* and the caller's callback must fire exactly once down every one of those paths.
*/
describe("aborting an upload", () => {
// The component's abort policy: up to ten retries after a 409, each waiting 100 ms times its number.
const ABORT_RETRY_BACKOFF_BASE_MS = 100;
const ABORT_RETRY_MAX_ATTEMPTS = 10;

beforeEach(() => {
vi.useFakeTimers();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ import { FileUploadItem } from "../../../type/dashboard-file.interface";
import { FilesUploaderComponent } from "../files-uploader/files-uploader.component";
import { StagedObjectsListComponent } from "../staged-objects-list/staged-objects-list.component";

export const ABORT_RETRY_MAX_ATTEMPTS = 10;
export const ABORT_RETRY_BACKOFF_BASE_MS = 100;
export const FINISHED_TASK_HIDE_DELAY_MS = 5000;
const ABORT_RETRY_MAX_ATTEMPTS = 10;
const ABORT_RETRY_BACKOFF_BASE_MS = 100;
const FINISHED_TASK_HIDE_DELAY_MS = 5000;

/**
* The "Create New Version" panel of a versioned resource's detail page: pick files, watch them
Expand Down Expand Up @@ -380,16 +380,12 @@ export class VersionUploaderComponent implements OnInit {
},
error: (res: unknown) => {
const err = res as HttpErrorResponse;
// Already gone, treat as done.
if (err.status === HttpStatusCode.NotFound) {
done();
return;
}
// Backend is still finalizing/aborting; retry with a tiny backoff.
if (err.status === HttpStatusCode.Conflict && attempt < ABORT_RETRY_MAX_ATTEMPTS) {
setTimeout(() => abortWithRetry(attempt + 1), ABORT_RETRY_BACKOFF_BASE_MS * (attempt + 1));
return;
}
// Any other error ends the abort, including a 404 for an upload that is already gone.
done();
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { ChangeDetectorRef, Component, Input, OnChanges, OnInit, SimpleChanges } from "@angular/core";
import { DomSanitizer, SafeHtml } from "@angular/platform-browser";
import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
import { AgentService } from "../../../service/agent/agent.service";
import { AgentService, IndexedTuple, Tuple, tupleColumns, tupleToRecord } from "../../../service/agent/agent.service";
import { AgentState } from "../../../service/agent/agent-types";
import { WorkflowActionService } from "../../../service/workflow-graph/model/workflow-action.service";
import { NotificationService } from "../../../../common/service/notification/notification.service";
Expand All @@ -41,7 +41,6 @@ import { NzTooltipDirective } from "ng-zorro-antd/tooltip";
import { NzInputDirective, NzAutosizeDirective } from "ng-zorro-antd/input";
import { NzButtonComponent } from "ng-zorro-antd/button";
import { NzWaveDirective } from "ng-zorro-antd/core/wave";
import { IndexedTuple, Tuple, tupleColumns, tupleToRecord } from "../../../service/agent/agent.service";
import type { WebOutputMode } from "../../../types/execute-workflow.interface";

interface TupleDisplayEntry {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/app/workspace/util/loop-block.util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// The backend's LogicalPlanSpec checks LogicalPlan.enclosingLoopStarts against the same file.
import loopBlocks from "../../../../../common/workflow-compiler/src/test/resources/loop-blocks.json";
import { enclosingLoopStarts, LOOP_END_OP_TYPE, LOOP_START_OP_TYPE } from "./loop-block.util";
import { enclosingLoopStarts, LOOP_START_OP_TYPE } from "./loop-block.util";

/** A case of loop-blocks.json: a graph, and the Loop Starts around each operator inside a block. */
interface LoopBlockCase {
Expand Down Expand Up @@ -87,7 +87,7 @@ describe("enclosingLoopStarts", () => {
const types = new Set(
[...loopBlocks.cases, ...loopBlocks.randomGraphs].flatMap(testCase => testCase.operators.map(({ type }) => type))
);
expect([...types].sort()).toEqual([LOOP_END_OP_TYPE, LOOP_START_OP_TYPE, "Operator"].sort());
expect([...types].sort()).toEqual(["LoopEnd", LOOP_START_OP_TYPE, "Operator"].sort());
});

it("finds nothing in an empty graph", () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/workspace/util/loop-block.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { OperatorLink, OperatorPredicate } from "../types/workflow-common.interf

/** The operator types that open and close a loop block, as the backend names them. */
export const LOOP_START_OP_TYPE = "LoopStart";
export const LOOP_END_OP_TYPE = "LoopEnd";
const LOOP_END_OP_TYPE = "LoopEnd";

type BlockOperator = Pick<OperatorPredicate, "operatorID" | "operatorType">;
type BlockLink = {
Expand Down
Loading