-
Notifications
You must be signed in to change notification settings - Fork 85
fix(docker): auto-build sdk & hub in build.rs #1972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying rivet-hub with
|
Latest commit: |
60c5a95
|
Status: | ✅ Deploy successful! |
Preview URL: | https://24d1d03e.rivet-hub-7jb.pages.dev |
Branch Preview URL: | https://01-29-fix-docker-auto-build.rivet-hub-7jb.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR implements significant changes to the build system and Docker configuration. Here's a summary of the key modifications:
- Introduces a new build ID system using timestamp+UUID instead of Git-based versioning across the hub application
- Enhances build script visibility by capturing and displaying yarn command outputs in build.rs files
- Modifies Docker configuration to support Node.js 22.x and adds caching for node dependencies
Key points to address:
- Hardcoded FontAwesome package token in Dockerfile needs to be removed (marked as TODO)
- Incorrect ENTRYPOINT commands in Dockerfile for isolate-v8-runner and container-runner stages using 'rivet-client'
- Duplicate package installations in Dockerfile's apt-get commands need consolidation
- Removal of Git-based versioning could impact development debugging capabilities
- The new build ID system may cause unnecessary cache invalidation since it changes on every build
14 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile
!docker/monolith | ||
docker/monolith/*.md | ||
# Rust | ||
**/target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Duplicate target ignore pattern (appears again on line 16). Remove one instance.
**/target | |
**/target/ |
**/.turbo | ||
**/.yarn | ||
**/dist/ | ||
**/node_modules/ | ||
**/target | ||
.turbo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Duplicate .turbo ignore pattern. Remove one instance.
**/.turbo | |
**/.yarn | |
**/dist/ | |
**/node_modules/ | |
**/target | |
.turbo | |
**/.turbo | |
**/.yarn | |
**/dist/ | |
**/node_modules/ | |
**/target |
**/target | ||
**/target/ | ||
**/*.rustfmt | ||
|
||
# JavaScript | ||
**/.cache/ | ||
**/.turbo | ||
**/.yarn | ||
**/dist/ | ||
**/node_modules/ | ||
**/target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Duplicate **/target entries (lines 8 and 16). One of these should be removed to avoid confusion.
**/target | |
**/target/ | |
**/*.rustfmt | |
# JavaScript | |
**/.cache/ | |
**/.turbo | |
**/.yarn | |
**/dist/ | |
**/node_modules/ | |
**/target | |
**/target | |
# JavaScript | |
**/.cache/ | |
**/.turbo | |
**/.yarn | |
**/dist/ | |
**/node_modules/ |
**/target | ||
.turbo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Redundant .turbo entry. Already covered by **/.turbo on line 12.
**/target | |
.turbo | |
**/target |
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 | ||
|
||
# TODO: REMOVE | ||
ENV FONTAWESOME_PACKAGE_TOKEN=E7A94808-3467-4150-B90D-EABDAEB9E0B4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Remove hardcoded FontAwesome token - this should be passed as a build arg or through a secrets mount
ENV FONTAWESOME_PACKAGE_TOKEN=E7A94808-3467-4150-B90D-EABDAEB9E0B4 | |
ARG FONTAWESOME_PACKAGE_TOKEN | |
ENV FONTAWESOME_PACKAGE_TOKEN=${FONTAWESOME_PACKAGE_TOKEN} |
@@ -10,7 +10,7 @@ initThirdPartyProviders(); | |||
rivetClient.cloud | |||
.bootstrap() | |||
.then((response) => { | |||
run({ cacheKey: [response.deployHash, __APP_GIT_COMMIT__].join("-") }); | |||
run({ cacheKey: [response.deployHash, __APP_BUILD_ID__].join("-") }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: This cache key will now change on every build instead of being tied to Git commits. Could cause more frequent cache invalidation than necessary in production.
__APP_BUILD_ID__: JSON.stringify( | ||
`${new Date().toISOString()}@${crypto.randomUUID()}`, | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: Build ID changes on every build, may cause excessive cache invalidation. Consider using a more stable identifier for development
assert!( | ||
yarn_check.is_ok() && yarn_check.unwrap().success(), | ||
"yarn is not installed, please install yarn to build this project" | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: unwrap() on yarn_check could panic if yarn_check.is_ok() is false. Consider using if-else logic instead of assert for better error handling.
assert!( | |
yarn_check.is_ok() && yarn_check.unwrap().success(), | |
"yarn is not installed, please install yarn to build this project" | |
); | |
if let Ok(status) = yarn_check { | |
if !status.success() { | |
return Err("yarn is installed but not working properly".into()); | |
} | |
} else { | |
return Err("yarn is not installed, please install yarn to build this project".into()); | |
} |
fs_extra::dir::copy( | ||
dist_path, | ||
dist_path.clone(), | ||
out_dir, | ||
&fs_extra::dir::CopyOptions::new().overwrite(true), | ||
&fs_extra::dir::CopyOptions::new().content_only(true), | ||
)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: dist_path.clone() is unnecessary since PathBuf is moved in the fs_extra::dir::copy call and not used afterwards
fs_extra::dir::copy( | |
dist_path, | |
dist_path.clone(), | |
out_dir, | |
&fs_extra::dir::CopyOptions::new().overwrite(true), | |
&fs_extra::dir::CopyOptions::new().content_only(true), | |
)?; | |
fs_extra::dir::copy( | |
dist_path, | |
out_dir, | |
&fs_extra::dir::CopyOptions::new().content_only(true), | |
)?; |
site/src/generated/.gitignore
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Removing all gitignore rules from generated directory could cause build artifacts and temporary files to be tracked. Consider keeping at least some exclusion rules.
* | |
!.gitignore | |
!errorPages.json | |
!apiPages.json | |
!meta.json |
c755e19
to
ee5a532
Compare
ee5a532
to
60c5a95
Compare
Merge activity
|
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
Changes