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

ci: update release workflows to use uv #3919

Merged
merged 13 commits into from
Sep 27, 2024
Merged

ci: update release workflows to use uv #3919

merged 13 commits into from
Sep 27, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This pull request updates the dependency management in the release and nightly build workflows to use 'uv' instead of Poetry. It replaces the installation and caching steps with 'uv' commands and modifies the Python setup to use the version specified in 'pyproject.toml'. The Node.js setup steps are also removed. This change improves the efficiency and consistency of the dependency management process.

…nd caching

- Replace Poetry with 'uv' for dependency installation and project setup
- Add steps to install 'uv' and set up caching for 'uv.lock'
- Modify Python setup to use version specified in 'pyproject.toml'
- Remove Node.js setup steps
- Replace Poetry with uv for dependency installation and caching
- Update Python setup to use version specified in pyproject.toml
- Add steps to restore uv cache and install project dependencies using uv
- Adjust publish steps to maintain functionality with new setup
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 25, 2024
@ogabrielluiz ogabrielluiz marked this pull request as draft September 25, 2024 21:11
@ogabrielluiz ogabrielluiz marked this pull request as ready for review September 25, 2024 21:20
@ogabrielluiz ogabrielluiz requested a review from phact September 25, 2024 21:21
@ogabrielluiz
Copy link
Contributor Author

ogabrielluiz commented Sep 26, 2024

I think we need to use this when building for release (--no-sources):
https://arc.net/l/quote/iznjjzrd

…isting' from publish commands

- Modified 'build_langflow' target to accept arguments.
- Removed '--skip-existing' from 'publish_base' and 'publish_base_testpypi' commands.
- Added TODO comments for updating test-pypi repository usage.
.github/workflows/release.yml Show resolved Hide resolved
.github/workflows/release_nightly.yml Outdated Show resolved Hide resolved
.github/workflows/release_nightly.yml Show resolved Hide resolved
- Removed 'v' prefix from version extraction in nightly release workflow.
- Added '--no-sources' argument to the build command in the distribution step.
Copy link
Collaborator

@phact phact left a comment

Choose a reason for hiding this comment

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

LGTM +1 once Jordan's comments get addressed.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 26, 2024
.github/workflows/release.yml Show resolved Hide resolved
Makefile Show resolved Hide resolved
…orkflow

- Corrected awk commands for extracting 'langflow-base' name and version.
- Added a new step to verify 'langflow-nightly' name and version against expected values.
@ogabrielluiz ogabrielluiz merged commit b06c3b1 into docker-uv Sep 27, 2024
8 checks passed
@ogabrielluiz ogabrielluiz deleted the update-ci-uv branch September 27, 2024 16:28
jordanrfrazier added a commit that referenced this pull request Sep 30, 2024
* fix dev dependencies

* fix dev dependencies

* update lock

* Add langchain-unstructured dependency to pyproject.toml

* Switch to uv-based Docker image and streamline build process

- Use `ghcr.io/astral-sh/uv:python3.12-bookworm-slim` as the base image
- Simplify environment variable setup and remove unnecessary ones
- Install project dependencies using `uv sync` with cache mounts
- Add and copy necessary files for the build process
- Update npm installation and frontend build steps
- Adjust entrypoint and runtime configurations
- Remove redundant user setup and streamline CMD execution

* Refactor Dockerfile to use multi-stage builds for optimized image size

- Introduce a builder stage to install dependencies and build the frontend.
- Use npm ci instead of npm install for more reliable builds.
- Copy built frontend assets to the final image.
- Transition to a runtime stage with a slimmer Python base image.
- Ensure the final image only contains necessary runtime dependencies.

* Switch base image to `ghcr.io/astral-sh/uv:python3.12-bookworm-slim` and update Dockerfile

- Replace `python:3.12.3-slim` with `ghcr.io/astral-sh/uv:python3.12-bookworm-slim` as the base image.
- Enable bytecode compilation and set link mode to copy.
- Update dependency installation process using `uv sync`.
- Simplify frontend build and copy process.
- Add OCI labels for image metadata.
- Update CMD to use `langflow-base` for running the application.

* Update Dockerfile to use uv base image and optimize dependency installation

- Switch base image to `ghcr.io/astral-sh/uv:python3.12-bookworm-slim`
- Combine apt-get commands and clean up to reduce image size
- Replace Poetry with uv for dependency management and caching

* Refactor Dockerfile to use multi-stage build for optimized image size

- Introduce a builder stage using `ghcr.io/astral-sh/uv:python3.12-bookworm-slim`
- Add a runtime stage using `python:3.12.3-slim`
- Copy the virtual environment from the builder stage to the runtime stage
- Remove the `uv` entrypoint to avoid invoking it by default

* Update Dockerfile: Fix indentation and remove redundant ENTRYPOINT reset

* ci: update release workflows to use uv (#3919)

* Update nightly build workflow to use 'uv' for dependency management and caching

- Replace Poetry with 'uv' for dependency installation and project setup
- Add steps to install 'uv' and set up caching for 'uv.lock'
- Modify Python setup to use version specified in 'pyproject.toml'
- Remove Node.js setup steps

* Update release workflow to use uv for dependency management

- Replace Poetry with uv for dependency installation and caching
- Update Python setup to use version specified in pyproject.toml
- Add steps to restore uv cache and install project dependencies using uv
- Adjust publish steps to maintain functionality with new setup

* Replace 'poetry publish' with 'uv publish' in Makefile for consistency

* Update nightly build workflow to use 'uv' for dependency management and caching

* Set up Node.js 20 in release_nightly workflow and update version verification logic

* Update Makefile to use `uv sync --frozen` for backend dependencies installation

* Update Makefile to pass arguments to 'uv build' and remove '--skip-existing' from publish commands

- Modified 'build_langflow' target to accept arguments.
- Removed '--skip-existing' from 'publish_base' and 'publish_base_testpypi' commands.
- Added TODO comments for updating test-pypi repository usage.

* Remove --skip-existing flag from uv publish commands and add TODO comments for test-pypi updates

* new lock

* Update CI workflow to remove version prefix and add build args

- Removed 'v' prefix from version extraction in nightly release workflow.
- Added '--no-sources' argument to the build command in the distribution step.

* Update CI workflow to use 'uv' for versioning and publishing

- Replace 'poetry' with 'uv' for version extraction in release checks

* Update CI workflow to use UV_PUBLISH_TOKEN for PyPI publishing

* Add verification step for 'langflow-nightly' name and version in CI workflow

- Corrected awk commands for extracting 'langflow-base' name and version.
- Added a new step to verify 'langflow-nightly' name and version against expected values.

* feat: Update dev.Dockerfile to use 'uv' for dependency management and caching

* update dockerfiles with --no-editable

---------

Co-authored-by: phact <[email protected]>
Co-authored-by: Jordan Frazier <[email protected]>
diogocabral pushed a commit to headlinevc/langflow that referenced this pull request Nov 26, 2024
* fix dev dependencies

* fix dev dependencies

* update lock

* Add langchain-unstructured dependency to pyproject.toml

* Switch to uv-based Docker image and streamline build process

- Use `ghcr.io/astral-sh/uv:python3.12-bookworm-slim` as the base image
- Simplify environment variable setup and remove unnecessary ones
- Install project dependencies using `uv sync` with cache mounts
- Add and copy necessary files for the build process
- Update npm installation and frontend build steps
- Adjust entrypoint and runtime configurations
- Remove redundant user setup and streamline CMD execution

* Refactor Dockerfile to use multi-stage builds for optimized image size

- Introduce a builder stage to install dependencies and build the frontend.
- Use npm ci instead of npm install for more reliable builds.
- Copy built frontend assets to the final image.
- Transition to a runtime stage with a slimmer Python base image.
- Ensure the final image only contains necessary runtime dependencies.

* Switch base image to `ghcr.io/astral-sh/uv:python3.12-bookworm-slim` and update Dockerfile

- Replace `python:3.12.3-slim` with `ghcr.io/astral-sh/uv:python3.12-bookworm-slim` as the base image.
- Enable bytecode compilation and set link mode to copy.
- Update dependency installation process using `uv sync`.
- Simplify frontend build and copy process.
- Add OCI labels for image metadata.
- Update CMD to use `langflow-base` for running the application.

* Update Dockerfile to use uv base image and optimize dependency installation

- Switch base image to `ghcr.io/astral-sh/uv:python3.12-bookworm-slim`
- Combine apt-get commands and clean up to reduce image size
- Replace Poetry with uv for dependency management and caching

* Refactor Dockerfile to use multi-stage build for optimized image size

- Introduce a builder stage using `ghcr.io/astral-sh/uv:python3.12-bookworm-slim`
- Add a runtime stage using `python:3.12.3-slim`
- Copy the virtual environment from the builder stage to the runtime stage
- Remove the `uv` entrypoint to avoid invoking it by default

* Update Dockerfile: Fix indentation and remove redundant ENTRYPOINT reset

* ci: update release workflows to use uv (langflow-ai#3919)

* Update nightly build workflow to use 'uv' for dependency management and caching

- Replace Poetry with 'uv' for dependency installation and project setup
- Add steps to install 'uv' and set up caching for 'uv.lock'
- Modify Python setup to use version specified in 'pyproject.toml'
- Remove Node.js setup steps

* Update release workflow to use uv for dependency management

- Replace Poetry with uv for dependency installation and caching
- Update Python setup to use version specified in pyproject.toml
- Add steps to restore uv cache and install project dependencies using uv
- Adjust publish steps to maintain functionality with new setup

* Replace 'poetry publish' with 'uv publish' in Makefile for consistency

* Update nightly build workflow to use 'uv' for dependency management and caching

* Set up Node.js 20 in release_nightly workflow and update version verification logic

* Update Makefile to use `uv sync --frozen` for backend dependencies installation

* Update Makefile to pass arguments to 'uv build' and remove '--skip-existing' from publish commands

- Modified 'build_langflow' target to accept arguments.
- Removed '--skip-existing' from 'publish_base' and 'publish_base_testpypi' commands.
- Added TODO comments for updating test-pypi repository usage.

* Remove --skip-existing flag from uv publish commands and add TODO comments for test-pypi updates

* new lock

* Update CI workflow to remove version prefix and add build args

- Removed 'v' prefix from version extraction in nightly release workflow.
- Added '--no-sources' argument to the build command in the distribution step.

* Update CI workflow to use 'uv' for versioning and publishing

- Replace 'poetry' with 'uv' for version extraction in release checks

* Update CI workflow to use UV_PUBLISH_TOKEN for PyPI publishing

* Add verification step for 'langflow-nightly' name and version in CI workflow

- Corrected awk commands for extracting 'langflow-base' name and version.
- Added a new step to verify 'langflow-nightly' name and version against expected values.

* feat: Update dev.Dockerfile to use 'uv' for dependency management and caching

* update dockerfiles with --no-editable

---------

Co-authored-by: phact <[email protected]>
Co-authored-by: Jordan Frazier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants