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

feat(app): use crc service #1483

Merged
merged 21 commits into from
Jul 5, 2023
Merged

feat(app): use crc service #1483

merged 21 commits into from
Jul 5, 2023

Conversation

olevski
Copy link
Member

@olevski olevski commented May 15, 2023

Uses the compute resource access control service for launching sessions.

@olevski olevski requested a review from a team as a code owner May 15, 2023 23:01
@olevski olevski marked this pull request as draft May 15, 2023 23:01
@olevski olevski force-pushed the feat-work-with-crac branch 2 times, most recently from 999ea22 to 396d5c5 Compare May 15, 2023 23:08
@olevski olevski force-pushed the feat-work-with-crac branch 5 times, most recently from 0560372 to 9fb8044 Compare May 16, 2023 15:34
@olevski olevski force-pushed the feat-work-with-crac branch 2 times, most recently from 00719ca to 6f99453 Compare May 25, 2023 13:10
@olevski olevski deployed to renku-ci-nb-1483 May 25, 2023 14:29 — with GitHub Actions Active
@RenkuBot
Copy link
Contributor

You can access the deployment of this PR at https://renku-ci-nb-1483.dev.renku.ch

@olevski olevski changed the title feat(app): use crac service feat(app): use crc service Jun 6, 2023
Dockerfile Show resolved Hide resolved
@olevski olevski marked this pull request as ready for review July 4, 2023 08:05
@olevski olevski requested a review from a team as a code owner July 4, 2023 08:05
Copy link
Member

@Panaetius Panaetius left a comment

Choose a reason for hiding this comment

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

thank you! nice to see this taking shape 🙂

Dockerfile Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
Dockerfile.tests Show resolved Hide resolved
git_services/Dockerfile.init Show resolved Hide resolved
git_services/Dockerfile.sidecar Show resolved Hide resolved
Comment on lines 60 to 61
# Memory and disk space in CRC are assumed to be in gigabytes whereas
# the notebook service assumes that if a plain number is used then it is bytes.
Copy link
Member

Choose a reason for hiding this comment

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

I'm a little confused here. storage comes directly from LaunchNotebookRequestWithoutS3/launch_notebook(), so isn't it in bytes? but above, we compare it directly to max_storage, which should be in gigabytes? Shouldn't there be a conversion somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

So the comment is not right. I updated the schema for the request in launch_notebook to be in gigabytes. But I did not update the comment. Now I added the assumption that disk and memory are in gigabytes in the docstring.

renku_notebooks/api/classes/crc.py Show resolved Hide resolved
Comment on lines 92 to 101
headers = None
if user.access_token is not None:
headers = {"Authorization": f"bearer {user.access_token}"}
res = requests.get(self.crc_url + "/resource_pools", headers=headers)
if res.status_code != 200:
raise IntermittentError(
message="The compute resource access control service sent "
"an unexpected response, please try again later",
)
resource_pools = res.json()
Copy link
Member

Choose a reason for hiding this comment

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

This code is duplicated three times (here and above), maybe it should be its own method?

)
else:
resources["limits"]["cpu"] = cpu_request
resources["limits"]["cpu"] = 3 * cpu_request
Copy link
Member

Choose a reason for hiding this comment

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

What's the 3 here?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is to allow the cpu to spike up momentarily. Because if we set the limit on the cpu it gets throttled and then when you create a new session it takes a really long time for the session to start up. If the limits are set to "lax" (i.e. "relaxed") then the limit is larger than the request. But if the limits are set to strict then the limit is the same as the request and the cpu is throttled.

Copy link
Member

Choose a reason for hiding this comment

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

makes sense. you should give it a descriptive name, random magic numbers in code aren't nice 🙂

renku_notebooks/api/schemas/server_options.py Show resolved Hide resolved
@olevski
Copy link
Member Author

olevski commented Jul 4, 2023

@Panaetius I addressed all the comments. The integration tests are failing because it seems that the oauth application used by the tests has been removed from gitlab. I will fix this later. I ran the integration tests locally and they all passed.

Panaetius
Panaetius previously approved these changes Jul 5, 2023
@olevski olevski merged commit 44ad3dd into master Jul 5, 2023
@olevski olevski deleted the feat-work-with-crac branch July 5, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants