chore: update dockerfiles and docker-build workflows to fix releases (#4317)
* bash -x * bash verbose * combine bash calls in uv run * combined python script * relative dir * pass args correctly * pass args correctly * function name * fix arg order * merge base and main * remove nightly -ep docker image for now * set up uv in the get-version job in docker-build.yml * v prefix for version in build job * use inputs.nightly_tag_main for checkout actions * mount root project metadata for base build * fix comment * continued dockerfile fixes for workspaces setup * fix path * ruff check fix
This commit is contained in:
parent
c7fed78181
commit
c1097d2dde
5 changed files with 93 additions and 31 deletions
18
.github/workflows/docker-build.yml
vendored
18
.github/workflows/docker-build.yml
vendored
|
|
@ -103,11 +103,14 @@ jobs:
|
|||
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
||||
persist-credentials: true
|
||||
|
||||
- name: "Setup Environment"
|
||||
uses: ./.github/actions/setup-uv
|
||||
|
||||
- name: Get Version from Input
|
||||
if: ${{ inputs.version != '' }}
|
||||
id: get-version-input
|
||||
run: |
|
||||
# Base version cannot have a version input, since you have to specify a valid main tag to checkout.
|
||||
# Base version cannot have a version input, since you have to specify a valid main tag to checkout.
|
||||
if [[ "${{ inputs.release_type }}" == "base" && "${{ inputs.version }}" != '' ]]; then
|
||||
echo "Cannot specify version for base release."
|
||||
echo "Build type is 'base' and version is non-empty. Exiting the workflow."
|
||||
|
|
@ -150,6 +153,10 @@ jobs:
|
|||
id: get-version-base
|
||||
run: |
|
||||
version=$(uv tree | grep 'langflow-base' | awk '{print $3}' | sed 's/^v//')
|
||||
if [ -z "$version" ]; then
|
||||
echo "Failed to extract version from uv tree output"
|
||||
exit 1
|
||||
fi
|
||||
echo version=$version
|
||||
echo version=$version >> $GITHUB_OUTPUT
|
||||
- name: Get Version Main
|
||||
|
|
@ -196,7 +203,7 @@ jobs:
|
|||
echo "docker_tags=langflowai/langflow${nightly_suffix}:${{ needs.get-version.outputs.version }},langflowai/langflow${nightly_suffix}:latest" >> $GITHUB_OUTPUT
|
||||
echo "ghcr_tags=ghcr.io/langflow-ai/langflow${nightly_suffix}:${{ needs.get-version.outputs.version }},ghcr.io/langflow-ai/langflow${nightly_suffix}:latest" >> $GITHUB_OUTPUT
|
||||
echo "file=./docker/build_and_push.Dockerfile" >> $GITHUB_OUTPUT
|
||||
else
|
||||
else
|
||||
echo "Invalid release type. Exiting the workflow."
|
||||
exit 1
|
||||
fi
|
||||
|
|
@ -208,7 +215,8 @@ jobs:
|
|||
- name: Check out the code at a specific ref
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.get-version.outputs.version || github.ref }}
|
||||
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
||||
#ref: ${{ needs.get-version.outputs.version && format('v{0}', needs.get-version.outputs.version) || github.ref }}
|
||||
persist-credentials: true
|
||||
- name: "Setup Environment"
|
||||
uses: ./.github/actions/setup-uv
|
||||
|
|
@ -284,7 +292,7 @@ jobs:
|
|||
- name: Check out the code at a specific ref
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.get-version.outputs.version || github.ref }}
|
||||
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
|
@ -332,7 +340,7 @@ jobs:
|
|||
- name: Check out the code at a specific ref
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ needs.get-version.outputs.version || github.ref }}
|
||||
ref: ${{ inputs.nightly_tag_main || github.ref }}
|
||||
- name: "Setup Environment"
|
||||
uses: ./.github/actions/setup-uv
|
||||
|
||||
|
|
|
|||
15
.github/workflows/nightly_build.yml
vendored
15
.github/workflows/nightly_build.yml
vendored
|
|
@ -16,7 +16,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
shell: bash -ex -o pipefail {0}
|
||||
permissions:
|
||||
# Required to create tag
|
||||
contents: write
|
||||
|
|
@ -69,17 +69,10 @@ jobs:
|
|||
git config --global user.email "bot-nightly-builds@langflow.org"
|
||||
git config --global user.name "Langflow Bot"
|
||||
|
||||
BASE_TAG="${{ steps.generate_base_tag.outputs.base_tag }}"
|
||||
echo "Updating base project version to $BASE_TAG"
|
||||
uv run ./scripts/ci/update_pyproject_name.py langflow-base-nightly base
|
||||
uv run ./scripts/ci/update_pyproject_version.py $BASE_TAG base
|
||||
|
||||
# Use the main tag created earlier
|
||||
MAIN_TAG="${{ steps.generate_main_tag.outputs.main_tag }}"
|
||||
echo "Updating main project version to $MAIN_TAG"
|
||||
uv run ./scripts/ci/update_pyproject_version.py $MAIN_TAG main
|
||||
uv run ./scripts/ci/update_pyproject_name.py langflow-nightly main
|
||||
uv run ./scripts/ci/update_uv_dependency.py $BASE_TAG
|
||||
BASE_TAG="${{ steps.generate_base_tag.outputs.base_tag }}"
|
||||
echo "Updating base project version to $BASE_TAG and updating main project version to $MAIN_TAG"
|
||||
uv run ./scripts/ci/update_pyproject_combined.py main $MAIN_TAG $BASE_TAG
|
||||
|
||||
uv lock
|
||||
cd src/backend/base && uv lock && cd ../../..
|
||||
|
|
|
|||
23
.github/workflows/release_nightly.yml
vendored
23
.github/workflows/release_nightly.yml
vendored
|
|
@ -222,16 +222,13 @@ jobs:
|
|||
nightly_tag_main: ${{ inputs.nightly_tag_main }}
|
||||
secrets: inherit
|
||||
|
||||
call_docker_build_main_ep:
|
||||
name: Call Docker Build Workflow for Langflow with Entrypoint
|
||||
if: always() && ${{ inputs.build_docker_ep == 'true' }}
|
||||
needs: [release-nightly-main]
|
||||
uses: ./.github/workflows/docker-build.yml
|
||||
with:
|
||||
release_type: main-ep
|
||||
nightly_tag_main: ${{ inputs.nightly_tag_main }}
|
||||
secrets: inherit
|
||||
|
||||
|
||||
|
||||
|
||||
# Not currently supported, let's add it later
|
||||
# call_docker_build_main_ep:
|
||||
# name: Call Docker Build Workflow for Langflow with Entrypoint
|
||||
# if: always() && ${{ inputs.build_docker_ep == 'true' }}
|
||||
# needs: [release-nightly-main]
|
||||
# uses: ./.github/workflows/docker-build.yml
|
||||
# with:
|
||||
# release_type: main-ep
|
||||
# nightly_tag_main: ${{ inputs.nightly_tag_main }}
|
||||
# secrets: inherit
|
||||
Loading…
Add table
Add a link
Reference in a new issue