Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,15 @@ object PveManager {
}
}

// The lock file is copied to /tmp/system-requirements-lock.txt inside every
// deployed image (see bin/computing-unit-master.dockerfile), so single-node
// Docker and Kubernetes both find it there. Only a source-tree dev run reads
// the repo-relative amber/ copy. `isLocal` alone can't distinguish a
// containerized single-node run (also non-k8s) from a dev run, so probe.
private def getSystemPath(isLocal: Boolean): Path = {
Paths.get(
if (isLocal) "amber/system-requirements-lock.txt"
else "/tmp/system-requirements-lock.txt"
)
val deployPath = Paths.get("/tmp/system-requirements-lock.txt")
if (Files.exists(deployPath)) deployPath
else Paths.get("amber/system-requirements-lock.txt")
Comment on lines +103 to +105

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should rely on "system-requirements-lock.txt" any more. we removed it in #5608

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR targets the release branch, where the lock files are currently present.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. please annotate fix(pve, v1.2) in PR title so we know this is targeting v1.2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

}

def getSystemPackages(isLocal: Boolean): Seq[String] = {
Expand Down
13 changes: 1 addition & 12 deletions bin/k8s/templates/gateway-routes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,9 @@ spec:
- path:
type: PathPrefix
value: /api/executions/result/export
backendRefs:
- group: gateway.envoyproxy.io
kind: Backend
name: texera-dynamic-backend
- matches:
- path:
type: PathPrefix
value: /pve
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /api/pve
value: /api/pve
backendRefs:
- group: gateway.envoyproxy.io
kind: Backend
Expand Down
7 changes: 7 additions & 0 deletions bin/single-node/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ http {
proxy_send_timeout 1d;
}

location /api/pve/ {
proxy_pass http://workflow-runtime-coordinator-service:8085;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

# nginx prefix locations match by longest prefix
location /api/ {
proxy_pass http://dashboard-service:8080;
proxy_set_header Host $host;
Expand Down
13 changes: 5 additions & 8 deletions frontend/proxy.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,15 @@
"secure": false,
"changeOrigin": true
},
"/api": {
"target": "http://localhost:8080",
"/api/pve": {
"target": "http://localhost:8085",
"secure": false,
"changeOrigin": false
},
"/pve": {
"target": "http://localhost:8085",
"/api": {
"target": "http://localhost:8080",
"secure": false,
"changeOrigin": false,
"pathRewrite": {
"^/pve": "/api/pve"
}
"changeOrigin": false
},
"/wsapi": {
"target": "http://localhost:8085",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { Observable } from "rxjs";
import { map } from "rxjs/operators";
import { HttpClient, HttpParams } from "@angular/common/http";
import { AuthService } from "../../../common/service/user/auth.service";
import { AppSettings } from "../../../common/app-setting";

export interface PackageResponse {
system: string[];
Expand Down Expand Up @@ -51,27 +52,27 @@ export class WorkflowPveService {

getSystemPackages(cuid: number): Observable<PackageResponse> {
const params = this.buildBaseParams().set("cuid", cuid.toString());
return this.http.get<PackageResponse>("/pve/system", { params });
return this.http.get<PackageResponse>(`${AppSettings.getApiEndpoint()}/pve/system`, { params });
}

fetchPVEs(cuid: number): Observable<PvePackageResponse[]> {
const params = this.buildBaseParams().set("cuid", cuid.toString());
return this.http.get<PvePackageResponse[]>("/pve/pves", { params });
return this.http.get<PvePackageResponse[]>(`${AppSettings.getApiEndpoint()}/pve/pves`, { params });
}

getUserPackages(cuid: number, pveName: string): Observable<string[]> {
return this.fetchPVEs(cuid).pipe(map(pves => pves.find(pve => pve.pveName === pveName)?.userPackages ?? []));
}

deleteEnvironments(cuid: number) {
return this.http.delete(`/pve/pves/${cuid}`);
return this.http.delete(`${AppSettings.getApiEndpoint()}/pve/pves/${cuid}`);
}

deletePackage(cuid: number, pveName: string, packageName: string) {
const params = this.buildBaseParams();

return this.http.delete<string[]>(
`/pve/${cuid}/${encodeURIComponent(pveName)}/packages/${encodeURIComponent(packageName)}`,
`${AppSettings.getApiEndpoint()}/pve/${cuid}/${encodeURIComponent(pveName)}/packages/${encodeURIComponent(packageName)}`,
{ params }
);
}
Expand Down
Loading