Skip to content

Commit

Permalink
* Made attempted fix of LinkPreserver component not actually working.…
Browse files Browse the repository at this point in the history
… (due to not having the @observer decorator; haven't yet tested if this fixes the frontend frequent-reconnection issue)

* Fixed that the "--release" rust flag was getting added alongside the "--profile release_clif" flag. (don't know why I didn't hit this earlier; maybe my laptop has a different version of tilt, docker, or kubernetes installed)
  • Loading branch information
Venryx committed May 9, 2024
1 parent 18901f9 commit ae639ab
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
7 changes: 3 additions & 4 deletions Packages/app-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
FROM $RUST_BASE_URL as cargo-build
ARG ENVIRONMENT
ARG debug_vs_release
ARG debug_vs_release_flag
ARG debug_vs_release_profile
ARG copy_from_path
# ----------
Expand Down Expand Up @@ -47,9 +46,9 @@ RUN --mount=type=cache,target=/usr/local/cargo,from=rust,source=/usr/local/cargo
# --mount=type=cache,target=/usr/local/rustup \
# --mount=type=cache,target=/cg_clif/dist/lib \
--mount=type=cache,target=/dm_repo/target \
# RUSTC_BOOTSTRAP=1 cargo rustc ${debug_vs_release_flag} -- -Z time-passes
# RUSTC_BOOTSTRAP=1 cargo build --timings ${debug_vs_release_flag} && \
cargo build --profile ${debug_vs_release_profile} --timings ${debug_vs_release_flag} && \
# RUSTC_BOOTSTRAP=1 cargo rustc --profile ${debug_vs_release_profile} -- -Z time-passes
# RUSTC_BOOTSTRAP=1 cargo build --profile ${debug_vs_release_profile} --timings && \
cargo build --profile ${debug_vs_release_profile} --timings && \
# move binary out of target folder, else will stay in cache volume and be inaccessible in later steps
mv ${copy_from_path} /dm_repo/Packages/app-server/app-server-binary

Expand Down
2 changes: 2 additions & 0 deletions Packages/client/Source/UI/@Root/LinkPreserver.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {BaseComponent} from "react-vextensions";
import {Observer} from "web-vcore";
import {gql, useSubscription} from "web-vcore/nm/@apollo/client";

export const LINK_PRESERVER_SUBSCRIPTION = gql`
Expand All @@ -11,6 +12,7 @@ subscription($input: LinkPreserverInput!) {
`;
type LinkPreserverResult = {alive: boolean, pageRefreshRequested: boolean};

@Observer
export class LinkPreserver extends BaseComponent<{}, {}> {
render() {
let {} = this.props;
Expand Down
7 changes: 3 additions & 4 deletions Packages/monitor-backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
FROM $RUST_BASE_URL as cargo-build
ARG ENVIRONMENT
ARG debug_vs_release
ARG debug_vs_release_flag
ARG debug_vs_release_profile
ARG copy_from_path
# ----------
Expand Down Expand Up @@ -41,9 +40,9 @@ WORKDIR /dm_repo/Packages/monitor-backend
# to clear the cache below (and all other mount-caches), run: docker builder prune --filter type=exec.cachemount
RUN --mount=type=cache,target=/usr/local/cargo,from=rust,source=/usr/local/cargo \
--mount=type=cache,target=/dm_repo/target \
# RUSTC_BOOTSTRAP=1 cargo rustc ${debug_vs_release_flag} -- -Z time-passes
# RUSTC_BOOTSTRAP=1 cargo build --timings ${debug_vs_release_flag} && \
cargo build --profile ${debug_vs_release_profile} --timings ${debug_vs_release_flag} && \
# RUSTC_BOOTSTRAP=1 cargo rustc --profile ${debug_vs_release_profile} -- -Z time-passes
# RUSTC_BOOTSTRAP=1 cargo build --profile ${debug_vs_release_profile} --timings && \
cargo build --profile ${debug_vs_release_profile} --timings && \
# move binary out of target folder, else will stay in cache volume and be inaccessible in later steps
mv ${copy_from_path} /dm_repo/Packages/monitor-backend/monitor-backend-binary

Expand Down
7 changes: 3 additions & 4 deletions Packages/web-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
FROM $RUST_BASE_URL as cargo-build
ARG ENVIRONMENT
ARG debug_vs_release
ARG debug_vs_release_flag
ARG debug_vs_release_profile
ARG copy_from_path
# ----------
Expand Down Expand Up @@ -42,9 +41,9 @@ WORKDIR /dm_repo/Packages/web-server
#RUN --mount=type=cache,target=/usr/local/cargo,from=dm-rust-base,source=/usr/local/cargo \
RUN --mount=type=cache,target=/usr/local/cargo,from=rust,source=/usr/local/cargo \
--mount=type=cache,target=/dm_repo/target \
# RUSTC_BOOTSTRAP=1 cargo rustc ${debug_vs_release_flag} -- -Z time-passes
# RUSTC_BOOTSTRAP=1 cargo build --timings ${debug_vs_release_flag} && \
cargo build --profile ${debug_vs_release_profile} --timings ${debug_vs_release_flag} && \
# RUSTC_BOOTSTRAP=1 cargo rustc --profile ${debug_vs_release_profile} -- -Z time-passes
# RUSTC_BOOTSTRAP=1 cargo build --profile ${debug_vs_release_profile} --timings && \
cargo build --profile ${debug_vs_release_profile} --timings && \
# move binary out of target folder, else will stay in cache volume and be inaccessible in later steps
mv ${copy_from_path} /dm_repo/Packages/web-server/web-server-binary

Expand Down
3 changes: 0 additions & 3 deletions Tilt/App.star
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def Start_App(g):
"RUST_BASE_URL": imageURL_rustBase,
"ENVIRONMENT": ENV,
"debug_vs_release": "release" if g["compileWithRelease"] else "debug",
"debug_vs_release_flag": "--release" if g["compileWithRelease"] else "",
"debug_vs_release_profile": "release_clif" if g["compileWithRelease"] else "dev_clif",
# docker doesn't seem to support string interpolation in COPY command, so do it here
"copy_from_path": CopyFromPath("monitor-backend"),
Expand All @@ -60,7 +59,6 @@ def Start_App(g):
"RUST_BASE_URL": imageURL_rustBase,
"ENVIRONMENT": ENV,
"debug_vs_release": "release" if g["compileWithRelease"] else "debug",
"debug_vs_release_flag": "--release" if g["compileWithRelease"] else "",
"debug_vs_release_profile": "release_clif" if g["compileWithRelease"] else "dev_clif",
# docker doesn't seem to support string interpolation in COPY command, so do it here
"copy_from_path": CopyFromPath("web-server"),
Expand All @@ -72,7 +70,6 @@ def Start_App(g):
"RUST_BASE_URL": imageURL_rustBase,
"ENVIRONMENT": ENV,
"debug_vs_release": "release" if g["compileWithRelease"] else "debug",
"debug_vs_release_flag": "--release" if g["compileWithRelease"] else "",
"debug_vs_release_profile": "release_clif" if g["compileWithRelease"] else "dev_clif",
# docker doesn't seem to support string interpolation in COPY command, so do it here
"copy_from_path": CopyFromPath("app-server"),
Expand Down
2 changes: 1 addition & 1 deletion package-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ function GetPortForwardCommandsStr(context) {

const extraTiltArgs = commandArgs.join(" ");
function RunTiltUp_ForSpecificPod(podName, port, tiltfileArgsStr) {
let command = `${PrepDockerCmd()} ${SetTileEnvCmd()} tilt up ${podName} --stream -f ./Tilt/Main.star --context dm-ovh --port ${port}`;
let command = `${PrepDockerCmd()} ${SetTileEnvCmd()} tilt up ${podName} --stream -f ./Tilt/Main.star --context dm-ovh --port ${port} -- --env prod`;
if (tiltfileArgsStr) command += ` -- --env prod ${tiltfileArgsStr} ${extraTiltArgs}`;
//const command_parts = command.split(" ");
const commandProcess = process.platform === "win32"
Expand Down

0 comments on commit ae639ab

Please sign in to comment.