You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "SarahAsad23 (via GitHub)" <gi...@apache.org> on 2026/06/11 00:10:23 UTC
[PR] fix(amber): Remove system-requirements-lock.txt [texera]
SarahAsad23 opened a new pull request, #5613:
URL: https://github.com/apache/texera/pull/5613
<!--
Thanks for sending a pull request (PR)! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
[Contributing to Texera](https://github.com/apache/texera/blob/main/CONTRIBUTING.md)
2. Ensure you have added or run the appropriate tests for your PR
3. If the PR is work in progress, mark it a draft on GitHub.
4. Please write your PR title to summarize what this PR proposes, we
are following Conventional Commits style for PR titles as well.
5. Be sure to keep the PR description updated to reflect all changes.
-->
### What changes were proposed in this PR?
<!--
Please clarify what changes you are proposing. The purpose of this section
is to outline the changes. Here are some tips for you:
1. If you propose a new API, clarify the use case for a new API.
2. If you fix a bug, you can clarify why it is a bug.
3. If it is a refactoring, clarify what has been changed.
3. It would be helpful to include a before-and-after comparison using
screenshots or GIFs.
4. Please consider writing useful notes for better and faster reviews.
-->
PR #4902 previously introduced a checked-in `system-requirements-lock.txt` file to detect version conflicts between user requested packages and Texera's system dependencies. This file contained a fully resolved dependency list, including transitive dependencies that are not present in r`equirements.txt`. Maintaining a static lock file is problematic because dependency resolution is environment dependent and time-dependent as discussed in issue #5034.
This PR removes the dependency on a static `system-requirements-lock.txt` file and generates the resolved system dependency list dynamically.
When the PVE configuration modal is opened for the first time:
A temporary Python virtual environment is created.
1. Texera's system requirements (`requirements.txt`) are installed into the temporary environment.
2. pip freeze is executed to capture the fully resolved dependency set, including all transitive dependencies.
3. The generated dependency list is used as the source of truth for package conflict detection.
This ensures that conflict checks are performed against the actual dependency versions resolved in the current environment rather than against a potentially stale lock file.
### Any related issues, documentation, discussions?
<!--
Please use this section to link other resources if not mentioned already.
1. If this PR fixes an issue, please include `Fixes #1234`, `Resolves #1234`
or `Closes #1234`. If it is only related, simply mention the issue number.
2. If there is design documentation, please add the link.
3. If there is a discussion in the mailing list, please add the link.
-->
Related PR: #4902 and related Issue: #5034. Closes #5608.
### How was this PR tested?
<!--
If tests were added, say they were added here. Or simply mention that if the PR
is tested with existing test cases. Make sure to include/update test cases that
check the changes thoroughly including negative and positive cases if possible.
If it was tested in a way different from regular unit tests, please clarify how
you tested step by step, ideally copy and paste-able, so that other reviewers can
test and check, and descendants can verify in the future. If tests were not added,
please describe why they were not added and/or why it was difficult to add.
-->
Tested manually and tests exist in `PveResourceSpec.scala`
### Was this PR authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this PR,
please include the phrase: 'Generated-by: ' followed by the name of the tool
and its version. If no, write 'No'.
Please refer to the [ASF Generative Tooling Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
Co-authored using: Claude Code
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3399243568
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
Review Comment:
Ok. I suggest we do rename later. It is not about user facing name: what user sees maybe different
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3399095291
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
Review Comment:
We could, but we've consistently referred to these as "system packages" in previous PVE PRs, and the frontend already uses that terminology when displaying the requirements. I'd prefer to keep the current naming for consistency.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3399147335
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
+ return Seq.empty
+ }
- def getSystemPackages(isLocal: Boolean): Seq[String] = {
- if (!Files.exists(getSystemPath(isLocal))) {
- Seq()
- } else {
- Files
- .readAllLines(getSystemPath(isLocal))
- .asScala
- .map(_.trim)
- .filter(line => line.nonEmpty && !line.startsWith("#"))
- .toSeq
+ val tempVenv = Files.createTempDirectory("texera-system-venv-")
Review Comment:
I'd prefer to keep the current naming for consistency with the rest of the PVE implementation, where we refer to these as system packages/requirements.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "xuang7 (via GitHub)" <gi...@apache.org>.
xuang7 commented on PR #5613:
URL: https://github.com/apache/texera/pull/5613#issuecomment-4695659392
I removed the backport label since this will need to be manually backported after merge. Could you resolve the merge conflict? Thanks! @SarahAsad23
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on PR #5613:
URL: https://github.com/apache/texera/pull/5613#issuecomment-4677748385
@SarahAsad23 I suggest you split the UI change to a separate task.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3393782148
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
Review Comment:
It is part of the computing unit master docker image which does the following:
`COPY --from=build /texera/amber/operator-requirements.txt /tmp/operator-requirements.txt`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3399244842
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
+ return Seq.empty
+ }
- def getSystemPackages(isLocal: Boolean): Seq[String] = {
- if (!Files.exists(getSystemPath(isLocal))) {
- Seq()
- } else {
- Files
- .readAllLines(getSystemPath(isLocal))
- .asScala
- .map(_.trim)
- .filter(line => line.nonEmpty && !line.startsWith("#"))
- .toSeq
+ val tempVenv = Files.createTempDirectory("texera-system-venv-")
Review Comment:
Ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #5613:
URL: https://github.com/apache/texera/pull/5613#issuecomment-4688360182
<!-- texera-benchmarks-comment -->
## Arrow Flight E2E bench
| batch | schema_w | str_len | n_batches | tuples/s | MB/s | p50 ms | p99 ms | total ms |
|---:|---:|---:|---:|---:|---:|---:|---:|---:|
| 10 | 10 | 64 | 20 | 428 | 0.261 | 22.76 | 32.90 | 467.12 |
| 100 | 10 | 64 | 20 | 928 | 0.566 | 106.35 | 139.43 | 2154.98 |
| 1000 | 10 | 64 | 20 | 1082 | 0.661 | 926.44 | 977.98 | 18481.23 |
<details><summary>Raw CSV</summary>
```csv
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,467.12,200,128000,428,0.261,22755.18,32897.76,32897.76
1,100,10,64,20,2154.98,2000,1280000,928,0.566,106346.90,139431.40,139431.40
2,1000,10,64,20,18481.23,20000,12800000,1082,0.661,926442.12,977976.55,977976.55
```
</details>
[Full workflow run](https://github.com/apache/texera/actions/runs/27400274749)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3399205215
##########
frontend/src/app/workspace/component/power-button/computing-unit-selection.component.html:
##########
@@ -472,28 +472,40 @@
</ng-template>
<nz-collapse-panel [nzHeader]="systemHeaderTpl">
<div class="system-panel-inner">
- <div class="package-header-row">
- <div class="package-column-label">Package</div>
- <div class="package-column-label">Version</div>
+ <div
+ *ngIf="systemPackagesLoading"
+ class="system-loading">
+ <span
+ nz-icon
+ nzType="loading"
+ nzTheme="outline"></span>
+ Fetching system packages…
</div>
- <div
- *ngFor="let pkg of systemPackages"
- class="package-row system-row">
- <div class="system-package-inputs">
- <input
- nz-input
- class="system-input"
- [disabled]="true"
- [ngModel]="pkg.name" />
+ <ng-container *ngIf="!systemPackagesLoading">
+ <div class="package-header-row">
+ <div class="package-column-label">Package</div>
+ <div class="package-column-label">Version</div>
Review Comment:
Removing `system-requirements-lock.txt` changes how system packages are loaded. Previously, the package list was available immediately from the lock file. With the new approach, the system package set is generated on demand by creating a temporary environment, installing the requirements, and running pip freeze, which introduces a noticeable delay on the initial load.
The UI changes are simply there to handle this new loading state and provide feedback to the user while the system packages are being resolved. Since the backend change directly impacts the user experience of the existing PVE feature, I felt it made sense to include the corresponding UI updates in the same PR. I could split them into a separate PR, but I'd prefer to keep them together.
UI for reference:
<img width="974" height="474" alt="Screenshot 2026-06-11 at 2 10 40 PM" src="https://github.com/user-attachments/assets/655b45c6-0994-427d-8a3b-a95eb889afa2" />
<img width="966" height="593" alt="Screenshot 2026-06-11 at 2 10 58 PM" src="https://github.com/user-attachments/assets/2b80d0f5-e7cf-45d8-b835-bcee89451e6f" />
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on PR #5613:
URL: https://github.com/apache/texera/pull/5613#issuecomment-4693301960
cc @xuang7 for v1.2 backport
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(amber): Remove system-requirements-lock.txt [texera]
Posted by "kunwp1 (via GitHub)" <gi...@apache.org>.
kunwp1 merged PR #5613:
URL: https://github.com/apache/texera/pull/5613
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3393640740
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
Review Comment:
can we call it pyamber packages?
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
Review Comment:
requirements.txt may not be part of docker image. @bobbai00 can you confirm?
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
+ return Seq.empty
+ }
- def getSystemPackages(isLocal: Boolean): Seq[String] = {
- if (!Files.exists(getSystemPath(isLocal))) {
- Seq()
- } else {
- Files
- .readAllLines(getSystemPath(isLocal))
- .asScala
- .map(_.trim)
- .filter(line => line.nonEmpty && !line.startsWith("#"))
- .toSeq
+ val tempVenv = Files.createTempDirectory("texera-system-venv-")
+ try {
+ val python = tempVenv.resolve("bin").resolve("python").toString
+ val createCode =
+ Process(Seq(PythonUtils.getPythonExecutable, "-m", "venv", tempVenv.toString)).!
+ if (createCode != 0) {
+ logger.error(s"failed to create temp venv for system-package resolution (exit=$createCode)")
+ return Seq.empty
+ }
+
+ val installCode = Process(
+ Seq(
+ python,
Review Comment:
Will all of these system calls work across different OSs, especially on Windows?
I am a bit concerned about putting too much OS-specific process logic directly in Scala. For example, commands for creating a virtual environment, activating it, setting environment variables, path handling, and shell syntax can behave differently between Linux/macOS and Windows.
My suggestion is to move the venv creation logic into scripts and let Scala invoke the appropriate script based on the OS. For example, we can provide one Unix shell script and one Windows script:
* create_venv.sh for Linux/macOS
* create_venv.bat or create_venv.ps1 for Windows
Then the Scala code only needs to detect the OS and call the corresponding script. This keeps the Scala side simpler and makes the platform-specific behavior easier to test and maintain.
##########
frontend/src/app/workspace/component/power-button/computing-unit-selection.component.html:
##########
@@ -472,28 +472,40 @@
</ng-template>
<nz-collapse-panel [nzHeader]="systemHeaderTpl">
<div class="system-panel-inner">
- <div class="package-header-row">
- <div class="package-column-label">Package</div>
- <div class="package-column-label">Version</div>
+ <div
+ *ngIf="systemPackagesLoading"
+ class="system-loading">
+ <span
+ nz-icon
+ nzType="loading"
+ nzTheme="outline"></span>
+ Fetching system packages…
</div>
- <div
- *ngFor="let pkg of systemPackages"
- class="package-row system-row">
- <div class="system-package-inputs">
- <input
- nz-input
- class="system-input"
- [disabled]="true"
- [ngModel]="pkg.name" />
+ <ng-container *ngIf="!systemPackagesLoading">
+ <div class="package-header-row">
+ <div class="package-column-label">Package</div>
+ <div class="package-column-label">Version</div>
Review Comment:
why are UI changes related to remove system-requirements-locks.txt?
##########
frontend/src/styles.scss:
##########
@@ -161,6 +161,15 @@ hr {
gap: 6px;
}
+ .system-loading {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 12px 4px;
+ color: rgba(0, 0, 0, 0.55);
+ font-style: italic;
+ }
Review Comment:
I am confused. is this related?
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
+ return Seq.empty
+ }
- def getSystemPackages(isLocal: Boolean): Seq[String] = {
- if (!Files.exists(getSystemPath(isLocal))) {
- Seq()
- } else {
- Files
- .readAllLines(getSystemPath(isLocal))
- .asScala
- .map(_.trim)
- .filter(line => line.nonEmpty && !line.startsWith("#"))
- .toSeq
+ val tempVenv = Files.createTempDirectory("texera-system-venv-")
Review Comment:
`pyamber-venv`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(amber): Remove system-requirements-lock.txt [texera]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3406949278
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -103,26 +114,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
Review Comment:
The PR removes `system-requirements-lock.txt`, but the container build still references it (e.g., `bin/computing-unit-master.dockerfile` copies `/texera/amber/system-requirements-lock.txt` to `/tmp`). Without updating that build artifact, Docker builds will fail due to a missing source file.
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -103,26 +114,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
+ return Seq.empty
+ }
- def getSystemPackages(isLocal: Boolean): Seq[String] = {
- if (!Files.exists(getSystemPath(isLocal))) {
- Seq()
- } else {
- Files
- .readAllLines(getSystemPath(isLocal))
- .asScala
- .map(_.trim)
- .filter(line => line.nonEmpty && !line.startsWith("#"))
- .toSeq
+ val tempVenv = Files.createTempDirectory("texera-system-venv-")
+ try {
+ val python = venvPython(tempVenv).toString
+ val createCode =
+ Process(Seq(PythonUtils.getPythonExecutable, "-m", "venv", tempVenv.toString)).!
Review Comment:
`resolveSystemPackages()` creates a temp venv using `Process(...).!` without a `ProcessLogger`, so any output goes directly to the process stdout/stderr (and failures lack context). This makes failures harder to diagnose and can spam server logs/console.
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -103,26 +114,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
+ return Seq.empty
+ }
- def getSystemPackages(isLocal: Boolean): Seq[String] = {
- if (!Files.exists(getSystemPath(isLocal))) {
- Seq()
- } else {
- Files
- .readAllLines(getSystemPath(isLocal))
- .asScala
- .map(_.trim)
- .filter(line => line.nonEmpty && !line.startsWith("#"))
- .toSeq
+ val tempVenv = Files.createTempDirectory("texera-system-venv-")
+ try {
+ val python = venvPython(tempVenv).toString
+ val createCode =
+ Process(Seq(PythonUtils.getPythonExecutable, "-m", "venv", tempVenv.toString)).!
+ if (createCode != 0) {
+ logger.error(s"failed to create temp venv for system-package resolution (exit=$createCode)")
+ return Seq.empty
+ }
+
+ val installCode = Process(
+ Seq(
+ python,
+ "-u",
+ "-m",
+ "pip",
+ "install",
+ "--progress-bar",
+ "off",
+ "--no-input",
+ "-r",
+ requirementsPath.toString
+ ),
+ None,
+ pipEnv.toSeq: _*
+ ).!
+ if (installCode != 0) {
+ logger.error(s"failed to install requirements into temp venv (exit=$installCode)")
+ return Seq.empty
+ }
+
+ val collected = scala.collection.mutable.ListBuffer[String]()
+ val freezeCode = Process(Seq(python, "-m", "pip", "freeze")).!(
+ ProcessLogger(line => collected += line, _ => ())
+ )
Review Comment:
`pip freeze` currently discards stderr (`_ => ()`). If `pip freeze` fails or emits warnings/errors, they won’t be visible anywhere, which makes diagnosis difficult.
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -103,26 +114,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
+ return Seq.empty
+ }
- def getSystemPackages(isLocal: Boolean): Seq[String] = {
- if (!Files.exists(getSystemPath(isLocal))) {
- Seq()
- } else {
- Files
- .readAllLines(getSystemPath(isLocal))
- .asScala
- .map(_.trim)
- .filter(line => line.nonEmpty && !line.startsWith("#"))
- .toSeq
+ val tempVenv = Files.createTempDirectory("texera-system-venv-")
+ try {
+ val python = venvPython(tempVenv).toString
+ val createCode =
+ Process(Seq(PythonUtils.getPythonExecutable, "-m", "venv", tempVenv.toString)).!
+ if (createCode != 0) {
+ logger.error(s"failed to create temp venv for system-package resolution (exit=$createCode)")
+ return Seq.empty
+ }
+
+ val installCode = Process(
+ Seq(
+ python,
+ "-u",
+ "-m",
+ "pip",
+ "install",
+ "--progress-bar",
+ "off",
+ "--no-input",
+ "-r",
+ requirementsPath.toString
+ ),
+ None,
+ pipEnv.toSeq: _*
+ ).!
Review Comment:
`pip install` in `resolveSystemPackages()` runs without capturing stdout/stderr (uses `. !` without a `ProcessLogger`). If it fails, we only get an exit code and may lose the actual pip error output that would be needed for debugging.
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -19,6 +19,9 @@
package org.apache.texera.web.resource.pythonvirtualenvironment
+import com.typesafe.scalalogging.LazyLogging
+import org.apache.commons.lang3.SystemUtils
+
Review Comment:
`PveManager` now depends on `org.apache.commons.lang3.SystemUtils`, but this PR doesn’t add an explicit `commons-lang3` dependency in sbt. If it’s not already on the compile classpath, this will fail to compile; even if it’s currently transitive, relying on it implicitly is brittle. Consider either adding an explicit dependency or switching to a JDK-based OS check (e.g., `java.io.File.separatorChar`).
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -401,8 +462,8 @@ object PveManager {
val code = runPipInstall(
python,
Seq(
- "--constraint", // check against system-requirements-lock
- getSystemPath(isLocal).toString,
+ "--constraint", // pin to the runtime-resolved system set
+ systemConstraintFile.toString,
Review Comment:
If resolving the system package set fails (e.g., transient pip/network failure), `systemPackages` becomes empty and we still proceed with user installs using an effectively empty `--constraint` file. That’s a fail-open behavior that can allow user installs to overwrite system deps (the exact thing this check is meant to prevent). Consider aborting user installs when system-package resolution fails.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on PR #5613:
URL: https://github.com/apache/texera/pull/5613#issuecomment-4695854543
This is more of a refactor PR than a fix. I suggest we do not backport to v1.2
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3393782148
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
Review Comment:
It is part of the computing unti master docker image which does the following:
`COPY --from=build /texera/amber/operator-requirements.txt /tmp/operator-requirements.txt`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3401299692
##########
frontend/src/app/workspace/component/power-button/computing-unit-selection.component.html:
##########
@@ -472,28 +472,40 @@
</ng-template>
<nz-collapse-panel [nzHeader]="systemHeaderTpl">
<div class="system-panel-inner">
- <div class="package-header-row">
- <div class="package-column-label">Package</div>
- <div class="package-column-label">Version</div>
+ <div
+ *ngIf="systemPackagesLoading"
+ class="system-loading">
+ <span
+ nz-icon
+ nzType="loading"
+ nzTheme="outline"></span>
+ Fetching system packages…
</div>
- <div
- *ngFor="let pkg of systemPackages"
- class="package-row system-row">
- <div class="system-package-inputs">
- <input
- nz-input
- class="system-input"
- [disabled]="true"
- [ngModel]="pkg.name" />
+ <ng-container *ngIf="!systemPackagesLoading">
+ <div class="package-header-row">
+ <div class="package-column-label">Package</div>
+ <div class="package-column-label">Version</div>
Review Comment:
I will separate them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3408319982
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -19,6 +19,9 @@
package org.apache.texera.web.resource.pythonvirtualenvironment
+import com.typesafe.scalalogging.LazyLogging
+import org.apache.commons.lang3.SystemUtils
+
Review Comment:
@SarahAsad23 PTAL
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3399943021
##########
frontend/src/app/workspace/component/power-button/computing-unit-selection.component.html:
##########
@@ -472,28 +472,40 @@
</ng-template>
<nz-collapse-panel [nzHeader]="systemHeaderTpl">
<div class="system-panel-inner">
- <div class="package-header-row">
- <div class="package-column-label">Package</div>
- <div class="package-column-label">Version</div>
+ <div
+ *ngIf="systemPackagesLoading"
+ class="system-loading">
+ <span
+ nz-icon
+ nzType="loading"
+ nzTheme="outline"></span>
+ Fetching system packages…
</div>
- <div
- *ngFor="let pkg of systemPackages"
- class="package-row system-row">
- <div class="system-package-inputs">
- <input
- nz-input
- class="system-input"
- [disabled]="true"
- [ngModel]="pkg.name" />
+ <ng-container *ngIf="!systemPackagesLoading">
+ <div class="package-header-row">
+ <div class="package-column-label">Package</div>
+ <div class="package-column-label">Version</div>
Review Comment:
I still suggest you separate them. For UI changes we need to see screenshots on the PR description, and you are mixing a fix and a feature.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3399228958
##########
frontend/src/styles.scss:
##########
@@ -161,6 +161,15 @@ hr {
gap: 6px;
}
+ .system-loading {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 12px 4px;
+ color: rgba(0, 0, 0, 0.55);
+ font-style: italic;
+ }
Review Comment:
Ditto.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on PR #5613:
URL: https://github.com/apache/texera/pull/5613#issuecomment-4696539240
@Yicong-Huang Is this PR ready to be merged?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(amber): Remove system-requirements-lock.txt [texera]
Posted by "Yicong-Huang (via GitHub)" <gi...@apache.org>.
Yicong-Huang commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3408318377
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -103,26 +114,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
Review Comment:
this should be fixed @SarahAsad23
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on PR #5613:
URL: https://github.com/apache/texera/pull/5613#issuecomment-4713945830
@Yicong-Huang All comments have been addressed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #5613:
URL: https://github.com/apache/texera/pull/5613#issuecomment-4675938128
## [Codecov](https://app.codecov.io/gh/apache/texera/pull/5613?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 52.47%. Comparing base ([`539a685`](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`299b13f`](https://app.codecov.io/gh/apache/texera/commit/299b13f9b0300fe481415e4e6f8f3e2a1babd590?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## main #5613 +/- ##
============================================
+ Coverage 52.45% 52.47% +0.01%
Complexity 2485 2485
============================================
Files 1071 1071
Lines 41366 41326 -40
Branches 4442 4434 -8
============================================
- Hits 21698 21685 -13
+ Misses 18399 18378 -21
+ Partials 1269 1263 -6
```
| [Flag](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
|---|---|---|---|
| [access-control-service](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `64.61% <ø> (ø)` | | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [agent-service](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `33.76% <ø> (ø)` | | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [amber](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `53.38% <ø> (+0.02%)` | :arrow_up: | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `1.65% <ø> (ø)` | | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [config-service](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `56.71% <ø> (ø)` | | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [file-service](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `38.21% <ø> (ø)` | | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [frontend](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `47.05% <ø> (+0.01%)` | :arrow_up: | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [pyamber](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `90.72% <ø> (ø)` | | |
| [python](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `90.75% <ø> (ø)` | | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/5613/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `58.69% <ø> (ø)` | | Carriedforward from [539a685](https://app.codecov.io/gh/apache/texera/commit/539a68551288a951d4c0a6d262105a8e6c211790?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
*This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
</details>
[:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/5613?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(amber): Remove system-requirements-lock.txt [texera]
Posted by "SarahAsad23 (via GitHub)" <gi...@apache.org>.
SarahAsad23 commented on code in PR #5613:
URL: https://github.com/apache/texera/pull/5613#discussion_r3399294940
##########
amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala:
##########
@@ -94,26 +96,95 @@ object PveManager {
}
}
- private def getSystemPath(isLocal: Boolean): Path = {
- Paths.get(
- if (isLocal) "amber/system-requirements-lock.txt"
- else "/tmp/system-requirements-lock.txt"
- )
- }
+ private def locateRequirementsTxt(): Option[Path] =
+ Seq(Paths.get("/tmp", "requirements.txt"), Paths.get("amber", "requirements.txt"))
+ .find(Files.exists(_))
+
+ // Resolves the fully-pinned system package set by installing requirements.txt
+ // into a throwaway venv and running `pip freeze`.
+ private def resolveSystemPackages(): Seq[String] = {
+ val requirementsPath = locateRequirementsTxt() match {
+ case Some(p) => p
+ case None =>
+ logger.error("requirements.txt not found; system package set will be empty")
+ return Seq.empty
+ }
- def getSystemPackages(isLocal: Boolean): Seq[String] = {
- if (!Files.exists(getSystemPath(isLocal))) {
- Seq()
- } else {
- Files
- .readAllLines(getSystemPath(isLocal))
- .asScala
- .map(_.trim)
- .filter(line => line.nonEmpty && !line.startsWith("#"))
- .toSeq
+ val tempVenv = Files.createTempDirectory("texera-system-venv-")
+ try {
+ val python = tempVenv.resolve("bin").resolve("python").toString
+ val createCode =
+ Process(Seq(PythonUtils.getPythonExecutable, "-m", "venv", tempVenv.toString)).!
+ if (createCode != 0) {
+ logger.error(s"failed to create temp venv for system-package resolution (exit=$createCode)")
+ return Seq.empty
+ }
+
+ val installCode = Process(
+ Seq(
+ python,
Review Comment:
The Process(Seq(python, ...)) invocations themselves are cross-platform as they bypass the shell and Python handles platform differences internally. The only Windows incompatible bit is the venv internal path: bin/python (POSIX) vs Scripts/python.exe (Windows). I'll factor that into a small helper rather than splitting into separate .sh/.bat/.ps1 scripts as the scripts would be 90% identical and the OS check is one line in Scala.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org