Skip to content

Commit e555e47

Browse files
erichareautofix-ci[bot]Cristhianzlvjgit96
authored
fix: Cherry-pick nightly SDK build fixes to main (#12491)
* fix: Build and install the langflow-sdk for lfx (fixes nightly) (#12481) * fix: Build and install the langflow-sdk for lfx * Publish sdk as a nightly * Update ci.yml * Update python_test.yml * Update ci.yml * fix: Properly grep for the langflow version (#12486) * fix: Properly grep for the langflow version * Mount the sdk where needed * Skip the sdk * [autofix.ci] apply automated fixes * Update setup.py * fix(docker): Remove broken npm self-upgrade from Docker images (#12309) * fix: replace grep -oP with sed for Node.js version extraction in Docker builds (#12331) The grep -oP (PCRE regex) command fails in the python:3.12.12-slim-trixie Docker base image because PCRE support is not available in the slim variant. This replaces grep -oP with portable sed -nE in all 5 Dockerfiles and adds an empty version guard to fail fast with a clear error message instead of producing a broken download URL. --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com> Co-authored-by: vjgit96 <vijay.katuri@ibm.com>
1 parent 65c3139 commit e555e47

24 files changed

Lines changed: 475 additions & 62 deletions

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ jobs:
380380
DOCS_ONLY: ${{ needs.path-filter.outputs.docs-only }}
381381
EXIT_CODE: ${{ (contains(needs.*.result, 'failure') ||
382382
contains(needs.*.result, 'cancelled') ||
383-
(needs.check-nightly-status.outputs.should-proceed != 'true' && github.event_name != 'workflow_dispatch' && needs.path-filter.outputs.docs-only != 'true'))
383+
(needs.check-nightly-status.outputs.should-proceed != 'true' && github.event_name != 'workflow_dispatch' && github.event_name != 'merge_group' && needs.path-filter.outputs.docs-only != 'true' && !contains(github.event.pull_request.labels.*.name, 'skip-nightly-check')))
384384
&& '1' || '0' }}
385385
steps:
386386
- name: "CI Success"

.github/workflows/cross-platform-test.yml

Lines changed: 104 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ on:
2222
description: "Name of the LFX package artifact"
2323
required: false
2424
type: string
25+
sdk-artifact-name:
26+
description: "Name of the langflow-sdk package artifact"
27+
required: false
28+
type: string
2529
pre_release:
2630
description: "Whether this is a pre-release build"
2731
required: false
@@ -161,6 +165,13 @@ jobs:
161165
shell: bash
162166

163167
# Download artifacts for wheel installation
168+
- name: Download langflow-sdk package artifact
169+
if: steps.install-method.outputs.method == 'wheel' && inputs.sdk-artifact-name != ''
170+
uses: actions/download-artifact@v7
171+
with:
172+
name: ${{ inputs.sdk-artifact-name }}
173+
path: ./sdk-dist
174+
164175
- name: Download LFX package artifact
165176
if: steps.install-method.outputs.method == 'wheel' && inputs.lfx-artifact-name != ''
166177
uses: actions/download-artifact@v7
@@ -187,9 +198,38 @@ jobs:
187198
uv venv test-env --seed
188199
shell: bash
189200

190-
# Wheel installation steps
201+
# Wheel installation steps — install SDK and LFX together when both are present.
202+
- name: Install SDK and LFX packages from wheel (Windows)
203+
if: steps.install-method.outputs.method == 'wheel' && matrix.os == 'windows' && inputs.sdk-artifact-name != '' && inputs.lfx-artifact-name != ''
204+
run: |
205+
ls -la ./sdk-dist/
206+
find ./sdk-dist -name "*.whl" -type f
207+
ls -la ./lfx-dist/
208+
find ./lfx-dist -name "*.whl" -type f
209+
SDK_WHEEL_FILE=$(find ./sdk-dist -name "*.whl" -type f | head -1)
210+
LFX_WHEEL_FILE=$(find ./lfx-dist -name "*.whl" -type f | head -1)
211+
if [ -n "$SDK_WHEEL_FILE" ] && [ -n "$LFX_WHEEL_FILE" ]; then
212+
uv pip install --prerelease=allow --python ./test-env/Scripts/python.exe "$SDK_WHEEL_FILE" "$LFX_WHEEL_FILE"
213+
else
214+
echo "Missing wheel file in ./sdk-dist/ or ./lfx-dist/"
215+
exit 1
216+
fi
217+
shell: bash
218+
219+
- name: Install SDK package from wheel (Windows)
220+
if: steps.install-method.outputs.method == 'wheel' && matrix.os == 'windows' && inputs.sdk-artifact-name != '' && inputs.lfx-artifact-name == ''
221+
run: |
222+
WHEEL_FILE=$(find ./sdk-dist -name "*.whl" -type f | head -1)
223+
if [ -n "$WHEEL_FILE" ]; then
224+
uv pip install --prerelease=allow --python ./test-env/Scripts/python.exe "$WHEEL_FILE"
225+
else
226+
echo "No wheel file found in ./sdk-dist/"
227+
exit 1
228+
fi
229+
shell: bash
230+
191231
- name: Install LFX package from wheel (Windows)
192-
if: steps.install-method.outputs.method == 'wheel' && matrix.os == 'windows' && inputs.lfx-artifact-name != ''
232+
if: steps.install-method.outputs.method == 'wheel' && matrix.os == 'windows' && inputs.lfx-artifact-name != '' && inputs.sdk-artifact-name == ''
193233
run: |
194234
ls -la ./lfx-dist/
195235
find ./lfx-dist -name "*.whl" -type f
@@ -230,8 +270,37 @@ jobs:
230270
fi
231271
shell: bash
232272

273+
- name: Install SDK and LFX packages from wheel (Unix)
274+
if: steps.install-method.outputs.method == 'wheel' && matrix.os != 'windows' && inputs.sdk-artifact-name != '' && inputs.lfx-artifact-name != ''
275+
run: |
276+
ls -la ./sdk-dist/
277+
find ./sdk-dist -name "*.whl" -type f
278+
ls -la ./lfx-dist/
279+
find ./lfx-dist -name "*.whl" -type f
280+
SDK_WHEEL_FILE=$(find ./sdk-dist -name "*.whl" -type f | head -1)
281+
LFX_WHEEL_FILE=$(find ./lfx-dist -name "*.whl" -type f | head -1)
282+
if [ -n "$SDK_WHEEL_FILE" ] && [ -n "$LFX_WHEEL_FILE" ]; then
283+
uv pip install --prerelease=allow --python ./test-env/bin/python "$SDK_WHEEL_FILE" "$LFX_WHEEL_FILE"
284+
else
285+
echo "Missing wheel file in ./sdk-dist/ or ./lfx-dist/"
286+
exit 1
287+
fi
288+
shell: bash
289+
290+
- name: Install SDK package from wheel (Unix)
291+
if: steps.install-method.outputs.method == 'wheel' && matrix.os != 'windows' && inputs.sdk-artifact-name != '' && inputs.lfx-artifact-name == ''
292+
run: |
293+
WHEEL_FILE=$(find ./sdk-dist -name "*.whl" -type f | head -1)
294+
if [ -n "$WHEEL_FILE" ]; then
295+
uv pip install --prerelease=allow --python ./test-env/bin/python "$WHEEL_FILE"
296+
else
297+
echo "No wheel file found in ./sdk-dist/"
298+
exit 1
299+
fi
300+
shell: bash
301+
233302
- name: Install LFX package from wheel (Unix)
234-
if: steps.install-method.outputs.method == 'wheel' && matrix.os != 'windows' && inputs.lfx-artifact-name != ''
303+
if: steps.install-method.outputs.method == 'wheel' && matrix.os != 'windows' && inputs.lfx-artifact-name != '' && inputs.sdk-artifact-name == ''
235304
run: |
236305
ls -la ./lfx-dist/
237306
find ./lfx-dist -name "*.whl" -type f
@@ -460,6 +529,13 @@ jobs:
460529
shell: bash
461530

462531
# Download artifacts for wheel installation
532+
- name: Download langflow-sdk package artifact
533+
if: steps.install-method.outputs.method == 'wheel' && inputs.sdk-artifact-name != ''
534+
uses: actions/download-artifact@v7
535+
with:
536+
name: ${{ inputs.sdk-artifact-name }}
537+
path: ./sdk-dist
538+
463539
- name: Download LFX package artifact
464540
if: steps.install-method.outputs.method == 'wheel' && inputs.lfx-artifact-name != ''
465541
uses: actions/download-artifact@v7
@@ -486,7 +562,31 @@ jobs:
486562
uv venv test-env --seed
487563
shell: bash
488564

489-
# Wheel installation steps
565+
# Wheel installation steps — install langflow-sdk before LFX (sdk is not yet on PyPI)
566+
- name: Install langflow-sdk from wheel (Windows)
567+
if: steps.install-method.outputs.method == 'wheel' && matrix.os == 'windows' && inputs.sdk-artifact-name != ''
568+
run: |
569+
WHEEL_FILE=$(find ./sdk-dist -name "*.whl" -type f | head -1)
570+
if [ -n "$WHEEL_FILE" ]; then
571+
uv pip install --prerelease=allow --python ./test-env/Scripts/python.exe "$WHEEL_FILE"
572+
else
573+
echo "No wheel file found in ./sdk-dist/"
574+
exit 1
575+
fi
576+
shell: bash
577+
578+
- name: Install langflow-sdk from wheel (Unix)
579+
if: steps.install-method.outputs.method == 'wheel' && matrix.os != 'windows' && inputs.sdk-artifact-name != ''
580+
run: |
581+
WHEEL_FILE=$(find ./sdk-dist -name "*.whl" -type f | head -1)
582+
if [ -n "$WHEEL_FILE" ]; then
583+
uv pip install --prerelease=allow --python ./test-env/bin/python "$WHEEL_FILE"
584+
else
585+
echo "No wheel file found in ./sdk-dist/"
586+
exit 1
587+
fi
588+
shell: bash
589+
490590
- name: Install LFX package from wheel (Windows)
491591
if: steps.install-method.outputs.method == 'wheel' && matrix.os == 'windows' && inputs.lfx-artifact-name != ''
492592
run: |

.github/workflows/docker-build-v2.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
- name: Determine version
125125
id: version
126126
run: |
127-
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | cut -d' ' -f2 | sed 's/^v//')
127+
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | grep -v '^langflow-sdk' | cut -d' ' -f2 | sed 's/^v//')
128128
echo "Main version from pyproject.toml: $version"
129129
130130
if [ ${{inputs.pre_release}} == "true" ]; then
@@ -603,7 +603,7 @@ jobs:
603603
if [[ "${{ inputs.release_type }}" == "base" ]]; then
604604
version=$(uv tree 2>/dev/null | grep 'langflow-base' | awk '{print $3}' | sed 's/^v//' | head -n 1)
605605
else
606-
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | cut -d' ' -f2 | sed 's/^v//')
606+
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | grep -v '^langflow-sdk' | cut -d' ' -f2 | sed 's/^v//')
607607
fi
608608
echo "Using version: $version"
609609
echo version=$version >> $GITHUB_OUTPUT

.github/workflows/docker-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ jobs:
150150
if: ${{ inputs.main_version == '' && (inputs.release_type == 'main' || inputs.release_type == 'main-ep' || inputs.release_type == 'nightly-main' || inputs.release_type == 'main-all' || inputs.release_type == 'nightly-main-all') }}
151151
id: get-version-main
152152
run: |
153-
version=$(uv tree | grep 'langflow' | grep -v 'langflow-base' | awk '{print $2}' | sed 's/^v//')
153+
version=$(uv tree | grep 'langflow' | grep -v 'langflow-base' | grep -v 'langflow-sdk' | awk '{print $2}' | sed 's/^v//')
154154
echo version=$version
155155
echo version=$version >> $GITHUB_OUTPUT
156156
setup:

.github/workflows/docker-nightly-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ jobs:
166166
id: version
167167
run: |
168168
echo "Extracting main version from pyproject.toml"
169-
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | cut -d' ' -f2 | sed 's/^v//')
169+
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | grep -v '^langflow-sdk' | cut -d' ' -f2 | sed 's/^v//')
170170
171171
# Verify nightly tag format
172172
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+$ ]]; then
@@ -259,7 +259,7 @@ jobs:
259259
id: version
260260
run: |
261261
echo "Extracting main version from pyproject.toml"
262-
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | cut -d' ' -f2 | sed 's/^v//')
262+
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | grep -v '^langflow-sdk' | cut -d' ' -f2 | sed 's/^v//')
263263
264264
# Verify nightly tag format
265265
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+\.dev[0-9]+$ ]]; then
@@ -347,7 +347,7 @@ jobs:
347347
if [[ "${{ inputs.release_type }}" == "nightly-base" ]]; then
348348
version=$(uv tree 2>/dev/null | grep 'langflow-base' | awk '{print $3}' | sed 's/^v//' | head -n 1)
349349
else
350-
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | cut -d' ' -f2 | sed 's/^v//')
350+
version=$(uv tree 2>/dev/null | grep '^langflow' | grep -v '^langflow-base' | grep -v '^langflow-sdk' | cut -d' ' -f2 | sed 's/^v//')
351351
fi
352352
echo "Using version: $version"
353353
echo version=$version >> $GITHUB_OUTPUT

.github/workflows/nightly_build.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
release_tag: ${{ steps.generate_release_tag.outputs.release_tag }}
8686
base_tag: ${{ steps.set_base_tag.outputs.base_tag }}
8787
lfx_tag: ${{ steps.generate_lfx_tag.outputs.lfx_tag }}
88+
sdk_tag: ${{ steps.generate_sdk_tag.outputs.sdk_tag }}
8889
steps:
8990
- name: Checkout code
9091
uses: actions/checkout@v6
@@ -138,6 +139,14 @@ jobs:
138139
echo "lfx_tag=$LFX_TAG" >> $GITHUB_OUTPUT
139140
echo "lfx_tag=$LFX_TAG"
140141
142+
- name: Generate SDK nightly tag
143+
id: generate_sdk_tag
144+
run: |
145+
# NOTE: This outputs the tag with the `v` prefix.
146+
SDK_TAG="$(uv run ./scripts/ci/sdk_nightly_tag.py)"
147+
echo "sdk_tag=$SDK_TAG" >> $GITHUB_OUTPUT
148+
echo "sdk_tag=$SDK_TAG"
149+
141150
- name: Commit tag
142151
id: commit_tag
143152
run: |
@@ -149,16 +158,19 @@ jobs:
149158
RELEASE_TAG="${{ steps.generate_release_tag.outputs.release_tag }}"
150159
BASE_TAG="${{ steps.generate_base_tag.outputs.base_tag }}"
151160
LFX_TAG="${{ steps.generate_lfx_tag.outputs.lfx_tag }}"
161+
SDK_TAG="${{ steps.generate_sdk_tag.outputs.sdk_tag }}"
162+
echo "Updating SDK project version to $SDK_TAG"
163+
uv run --no-sync ./scripts/ci/update_sdk_version.py $SDK_TAG
152164
echo "Updating LFX project version to $LFX_TAG"
153-
uv run ./scripts/ci/update_lfx_version.py $LFX_TAG
165+
uv run --no-sync ./scripts/ci/update_lfx_version.py $LFX_TAG $SDK_TAG
154166
echo "Updating base project version to $BASE_TAG and updating main project version to $RELEASE_TAG"
155167
uv run --no-sync ./scripts/ci/update_pyproject_combined.py main $RELEASE_TAG $BASE_TAG $LFX_TAG
156168
157169
uv lock
158170
cd src/backend/base && uv lock && cd ../../..
159171
cd src/lfx && uv lock && cd ../..
160172
161-
git add pyproject.toml src/backend/base/pyproject.toml src/lfx/pyproject.toml uv.lock src/backend/base/uv.lock
173+
git add pyproject.toml src/backend/base/pyproject.toml src/lfx/pyproject.toml src/sdk/pyproject.toml uv.lock src/backend/base/uv.lock
162174
git commit -m "Update version and project name"
163175
164176
echo "Tagging main with $RELEASE_TAG"
@@ -278,6 +290,7 @@ jobs:
278290
nightly_tag_release: ${{ needs.create-nightly-tag.outputs.release_tag }}
279291
nightly_tag_base: ${{ needs.create-nightly-tag.outputs.base_tag }}
280292
nightly_tag_lfx: ${{ needs.create-nightly-tag.outputs.lfx_tag }}
293+
nightly_tag_sdk: ${{ needs.create-nightly-tag.outputs.sdk_tag }}
281294
# When triggered by schedule, inputs.push_to_registry is not set, so default to true
282295
# When triggered manually, use the provided value (default is also true)
283296
push_to_registry: ${{ github.event_name == 'schedule' || inputs.push_to_registry != false }}

.github/workflows/python_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
- name: Run unit tests
9494
uses: nick-fields/retry@v3
9595
with:
96-
timeout_minutes: 12
96+
timeout_minutes: 15
9797
max_attempts: 2
9898
command: make unit_tests args="-x -vv --splits ${{ matrix.splitCount }} --group ${{ matrix.group }} --reruns 5 --cov --cov-config=src/backend/.coveragerc --cov-report=xml --cov-report=html"
9999

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ jobs:
188188
- name: Determine version
189189
id: version
190190
run: |
191-
version=$(uv tree | grep 'langflow' | grep -v 'langflow-base' | awk '{print $2}' | sed 's/^v//')
191+
version=$(uv tree | grep 'langflow' | grep -v 'langflow-base' | grep -v 'langflow-sdk' | awk '{print $2}' | sed 's/^v//')
192192
echo "Main version from pyproject.toml: $version"
193193
194194
if [ ${{inputs.pre_release}} == "true" ]; then

0 commit comments

Comments
 (0)