docker rc version fix
This commit is contained in:
parent
795cbe3b60
commit
999a2d0e71
3 changed files with 24 additions and 30 deletions
35
.github/workflows/build-multiarch.yml
vendored
35
.github/workflows/build-multiarch.yml
vendored
|
|
@ -14,6 +14,7 @@ jobs:
|
||||||
outputs:
|
outputs:
|
||||||
skip_release: ${{ steps.version.outputs.skip_release }}
|
skip_release: ${{ steps.version.outputs.skip_release }}
|
||||||
version: ${{ steps.version.outputs.version }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
|
docker_version: ${{ steps.version.outputs.docker_version }}
|
||||||
is_prerelease: ${{ steps.version.outputs.is_prerelease }}
|
is_prerelease: ${{ steps.version.outputs.is_prerelease }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|
@ -26,6 +27,12 @@ jobs:
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
echo "Version: $VERSION"
|
echo "Version: $VERSION"
|
||||||
|
|
||||||
|
# Normalize version per PEP 440 for Docker tags
|
||||||
|
# e.g., "0.1.53-rc2" -> "0.1.53rc2" to match Python's importlib.metadata
|
||||||
|
DOCKER_VERSION=$(echo "$VERSION" | sed -E 's/-?(rc|alpha|beta|dev|post)/\1/g')
|
||||||
|
echo "docker_version=$DOCKER_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
echo "Docker Version: $DOCKER_VERSION"
|
||||||
|
|
||||||
# Check if tag already exists
|
# Check if tag already exists
|
||||||
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
if git rev-parse "v$VERSION" >/dev/null 2>&1; then
|
||||||
echo "Tag v$VERSION already exists, skipping release"
|
echo "Tag v$VERSION already exists, skipping release"
|
||||||
|
|
@ -117,13 +124,6 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Extract version from pyproject.toml
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2)
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
echo "Version: $VERSION"
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
|
@ -141,7 +141,7 @@ jobs:
|
||||||
file: ${{ matrix.file }}
|
file: ${{ matrix.file }}
|
||||||
platforms: ${{ matrix.platform }}
|
platforms: ${{ matrix.platform }}
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ matrix.tag }}:${{ steps.version.outputs.version }}-${{ matrix.arch }}
|
tags: ${{ matrix.tag }}:${{ needs.check-version.outputs.docker_version }}-${{ matrix.arch }}
|
||||||
cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.arch }}
|
cache-from: type=gha,scope=${{ matrix.image }}-${{ matrix.arch }}
|
||||||
cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.arch }}
|
cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.arch }}
|
||||||
|
|
||||||
|
|
@ -153,12 +153,6 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Extract version from pyproject.toml
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2)
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -167,7 +161,7 @@ jobs:
|
||||||
|
|
||||||
- name: Create and push multi-arch manifests
|
- name: Create and push multi-arch manifests
|
||||||
run: |
|
run: |
|
||||||
VERSION=${{ steps.version.outputs.version }}
|
VERSION=${{ needs.check-version.outputs.docker_version }}
|
||||||
|
|
||||||
# Create versioned tags
|
# Create versioned tags
|
||||||
docker buildx imagetools create -t langflowai/openrag-backend:$VERSION \
|
docker buildx imagetools create -t langflowai/openrag-backend:$VERSION \
|
||||||
|
|
@ -224,13 +218,6 @@ jobs:
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v3
|
uses: astral-sh/setup-uv@v3
|
||||||
|
|
||||||
- name: Extract version from pyproject.toml
|
|
||||||
id: version
|
|
||||||
run: |
|
|
||||||
VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2)
|
|
||||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
||||||
echo "Version: $VERSION"
|
|
||||||
|
|
||||||
- name: Build wheel and source distribution
|
- name: Build wheel and source distribution
|
||||||
run: |
|
run: |
|
||||||
uv build
|
uv build
|
||||||
|
|
@ -253,8 +240,8 @@ jobs:
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
tag_name: v${{ steps.version.outputs.version }}
|
tag_name: v${{ needs.check-version.outputs.version }}
|
||||||
name: Release ${{ steps.version.outputs.version }}
|
name: Release ${{ needs.check-version.outputs.version }}
|
||||||
draft: false
|
draft: false
|
||||||
prerelease: ${{ needs.check-version.outputs.is_prerelease }}
|
prerelease: ${{ needs.check-version.outputs.is_prerelease }}
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
|
|
|
||||||
|
|
@ -1040,7 +1040,7 @@ class ContainerManager:
|
||||||
up_success = {"value": True}
|
up_success = {"value": True}
|
||||||
error_messages = []
|
error_messages = []
|
||||||
|
|
||||||
async for message, replace_last in self._stream_compose_command(["up", "-d"], up_success, cpu_mode):
|
async for message, replace_last in self._stream_compose_command(["up", "-d", "--no-build"], up_success, cpu_mode):
|
||||||
# Detect error patterns in the output
|
# Detect error patterns in the output
|
||||||
lower_msg = message.lower()
|
lower_msg = message.lower()
|
||||||
|
|
||||||
|
|
@ -1115,7 +1115,7 @@ class ContainerManager:
|
||||||
# Restart with new images using streaming output
|
# Restart with new images using streaming output
|
||||||
restart_success = True
|
restart_success = True
|
||||||
async for message, replace_last in self._run_compose_command_streaming(
|
async for message, replace_last in self._run_compose_command_streaming(
|
||||||
["up", "-d", "--force-recreate"], cpu_mode
|
["up", "-d", "--force-recreate", "--no-build"], cpu_mode
|
||||||
):
|
):
|
||||||
yield False, message, replace_last
|
yield False, message, replace_last
|
||||||
# Check for error patterns in the output
|
# Check for error patterns in the output
|
||||||
|
|
|
||||||
|
|
@ -315,15 +315,22 @@ class CommandOutputModal(ModalScreen):
|
||||||
asyncio.create_task(callback_result)
|
asyncio.create_task(callback_result)
|
||||||
|
|
||||||
self.call_after_refresh(_invoke_callback)
|
self.call_after_refresh(_invoke_callback)
|
||||||
|
except asyncio.CancelledError:
|
||||||
|
# Modal was dismissed while command was running - this is fine
|
||||||
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._update_output(f"Error: {e}", False)
|
self._update_output(f"Error: {e}", False)
|
||||||
output.text = "\n".join(self._output_lines)
|
output.text = "\n".join(self._output_lines)
|
||||||
output.move_cursor((len(self._output_lines), 0))
|
output.move_cursor((len(self._output_lines), 0))
|
||||||
finally:
|
finally:
|
||||||
# Enable the close button and focus it
|
# Enable the close button and focus it (if modal still exists)
|
||||||
close_btn = self.query_one("#close-btn", Button)
|
try:
|
||||||
close_btn.disabled = False
|
close_btn = self.query_one("#close-btn", Button)
|
||||||
close_btn.focus()
|
close_btn.disabled = False
|
||||||
|
close_btn.focus()
|
||||||
|
except Exception:
|
||||||
|
# Modal was already dismissed
|
||||||
|
pass
|
||||||
|
|
||||||
def _update_output(self, message: str, replace_last: bool = False) -> None:
|
def _update_output(self, message: str, replace_last: bool = False) -> None:
|
||||||
"""Update the output buffer by appending or replacing the last line.
|
"""Update the output buffer by appending or replacing the last line.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue