Skip to content
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

fix(render): reduce memory and handle server file #10055

Merged
merged 3 commits into from
Feb 23, 2024
Merged

Conversation

jtoar
Copy link
Contributor

@jtoar jtoar commented Feb 22, 2024

Made some improvements to the render deploy command while debugging an issue with realtime on their platform (see https://community.redwoodjs.com/t/redwood-realtime-on-render-com/5796 for the original issue). Note that while this PR fixes the original issue (subscriptions is not an allowed operation), realtime itself still doesn't work as expected. Currently trying to isolate render if it is specific to them. But these are valid fixes in the meantime:

  • should improve the memory usage problem by 1) requiring cli-data-migrate to be a devDependency prior to deploy and 2) not importing from the cli's lib which brings in the whole world 3) not using execa's shell option which isn't recommended
  • render will now use the server file if it's there

@jtoar jtoar added the release:fix This PR is a fix label Feb 22, 2024
@jtoar jtoar added this to the next-release-patch milestone Feb 22, 2024
path.join(rwjsPaths.base, 'node_modules/.bin/prisma'),
['migrate', 'deploy', '--schema', `"${rwjsPaths.api.dbSchema}"`],
'node_modules/.bin/prisma',
['migrate', 'deploy', '--schema', rwjsPaths.api.dbSchema],
Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM Feb 22, 2024

Choose a reason for hiding this comment

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

Did this (the rwjsPaths.api.dbSchema) need to be explicitly quoted to support things like spaces in paths? I can't remember if execa handles that for you or not - I should look it up.

Copy link
Contributor Author

jtoar commented Feb 22, 2024

not sure but that seems likely. if we add back the quotes, we have to add back the shell: true config to execa. it just wasn’t working with those extra quotes and without the shell option. not sure exactly why again. but adding back shell probably doesn’t incur that much memory

Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM left a comment

Choose a reason for hiding this comment

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

Unless I'm mistaken this was tested with a yarn patch approach and worked. One minor comment but looks good.

@Josh-Walker-GM
Copy link
Collaborator

I feel like escaping the args passed in is something execa should be doing so I would vote not to undo your change here. Unless I can find some execa docs stating otherwise

@jtoar jtoar changed the title fix(render): update deploy command for render fix(render): reduce memory and handle server file Feb 23, 2024
@jtoar
Copy link
Contributor Author

jtoar commented Feb 23, 2024

@Josh-Walker-GM I couldn't be sure if the quotes really mattered since I didn't test a scenario for it so reverting on that for now which means adding shell: true back. I think that's ok till we get more insight; the data migrations change is what should really reduce memory.

@jtoar jtoar merged commit d5214c9 into main Feb 23, 2024
41 checks passed
@jtoar jtoar deleted the ds-render/fix-api-deploy branch February 23, 2024 10:04
jtoar added a commit that referenced this pull request Feb 24, 2024
Made some improvements to the render deploy command while debugging an
issue with realtime on their platform (see
https://community.redwoodjs.com/t/redwood-realtime-on-render-com/5796
for the original issue). Note that while this PR fixes the original
issue (subscriptions is not an allowed operation), realtime itself still
doesn't work as expected. Currently trying to isolate render if it is
specific to them. But these are valid fixes in the meantime:

- should improve the memory usage problem by 1) requiring
cli-data-migrate to be a devDependency prior to deploy and 2) not
importing from the cli's lib which brings in the whole world 3) not
using execa's shell option which isn't recommended
- render will now use the server file if it's there
@jtoar jtoar modified the milestones: next-release-patch, v7.0.3 Feb 26, 2024
jtoar added a commit that referenced this pull request Feb 26, 2024
Made some improvements to the render deploy command while debugging an
issue with realtime on their platform (see
https://community.redwoodjs.com/t/redwood-realtime-on-render-com/5796
for the original issue). Note that while this PR fixes the original
issue (subscriptions is not an allowed operation), realtime itself still
doesn't work as expected. Currently trying to isolate render if it is
specific to them. But these are valid fixes in the meantime:

- should improve the memory usage problem by 1) requiring
cli-data-migrate to be a devDependency prior to deploy and 2) not
importing from the cli's lib which brings in the whole world 3) not
using execa's shell option which isn't recommended
- render will now use the server file if it's there
jtoar added a commit that referenced this pull request Feb 27, 2024
Similar to #10055, updates the
setup command for Coherence to detect the server file. This deployed
successfully in this commit on deploy target CI here:
redwoodjs/deploy-target-ci@4e5883e.
jtoar added a commit that referenced this pull request Feb 27, 2024
Similar to #10055, updates the
setup command for Coherence to detect the server file. This deployed
successfully in this commit on deploy target CI here:
redwoodjs/deploy-target-ci@4e5883e.
jtoar added a commit that referenced this pull request Feb 28, 2024
Similar to #10055, updates the
setup command for Coherence to detect the server file. This deployed
successfully in this commit on deploy target CI here:
redwoodjs/deploy-target-ci@4e5883e.
jtoar added a commit that referenced this pull request Feb 28, 2024
Similar to #10055, updates the
setup command for Coherence to detect the server file. This deployed
successfully in this commit on deploy target CI here:
redwoodjs/deploy-target-ci@4e5883e.
jtoar added a commit that referenced this pull request Feb 28, 2024
Similar to #10055, updates the
setup command for Coherence to detect the server file. This deployed
successfully in this commit on deploy target CI here:
redwoodjs/deploy-target-ci@4e5883e.
jtoar added a commit that referenced this pull request Feb 28, 2024
Similar to #10055, updates the
setup command for Coherence to detect the server file. This deployed
successfully in this commit on deploy target CI here:
redwoodjs/deploy-target-ci@4e5883e.
jtoar added a commit that referenced this pull request Feb 29, 2024
At first this PR was similar to
#10055 but for Flightcontrol.
But in the process of testing that and updating deploy target CI, I
noticed a few other things were off:

- coherence logic for the server file was flipped. fixed here
- in general, a few duplicate ways of checking for the server file.
tried to dedupe them the best i could without making massive changes
- stylistic change to render
- the flightcontrol setup wasn't handing corepack

Test as much as I could locally. Going to get this one into next so I
can test in deploy target CI.
jtoar added a commit that referenced this pull request Feb 29, 2024
At first this PR was similar to
#10055 but for Flightcontrol.
But in the process of testing that and updating deploy target CI, I
noticed a few other things were off:

- coherence logic for the server file was flipped. fixed here
- in general, a few duplicate ways of checking for the server file.
tried to dedupe them the best i could without making massive changes
- stylistic change to render
- the flightcontrol setup wasn't handing corepack

Test as much as I could locally. Going to get this one into next so I
can test in deploy target CI.
jtoar added a commit that referenced this pull request Feb 29, 2024
At first this PR was similar to
#10055 but for Flightcontrol.
But in the process of testing that and updating deploy target CI, I
noticed a few other things were off:

- coherence logic for the server file was flipped. fixed here
- in general, a few duplicate ways of checking for the server file.
tried to dedupe them the best i could without making massive changes
- stylistic change to render
- the flightcontrol setup wasn't handing corepack

Test as much as I could locally. Going to get this one into next so I
can test in deploy target CI.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants