docker: improve image layout and backend-only/frontend-only images (#2071)
* docker: improve image layout and backend-only image * add tests * add tests * add frontend * add frontend * label * fix
This commit is contained in:
parent
b74dd3fa7d
commit
ba59a9f449
9 changed files with 233 additions and 48 deletions
22
.github/workflows/docker-build.yml
vendored
22
.github/workflows/docker-build.yml
vendored
|
|
@ -54,6 +54,28 @@ jobs:
|
|||
tags: ${{ env.TAGS }}
|
||||
- name: Wait for Docker Hub to propagate
|
||||
run: sleep 120
|
||||
- name: Build and push (backend)
|
||||
if: ${{ inputs.release_type == 'main' }}
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: ./docker/build_and_push_backend.Dockerfile
|
||||
build-args: |
|
||||
LANGFLOW_IMAGE=langflowai/langflow:${{ inputs.version }}
|
||||
tags: |
|
||||
langflowai/langflow-backend:${{ inputs.version }}
|
||||
langflowai/langflow-backend:1.0-alpha
|
||||
- name: Build and push (frontend)
|
||||
if: ${{ inputs.release_type == 'main' }}
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: ./docker/frontend/build_and_push_frontend.Dockerfile
|
||||
tags: |
|
||||
langflowai/langflow-frontend:${{ inputs.version }}
|
||||
langflowai/langflow-frontend:1.0-alpha
|
||||
|
||||
restart-space:
|
||||
runs-on: ubuntu-latest
|
||||
|
|
|
|||
61
.github/workflows/docker_test.yml
vendored
Normal file
61
.github/workflows/docker_test.yml
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
name: Test Docker images
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "docker/**"
|
||||
- "poetry.lock"
|
||||
- "pyproject.toml"
|
||||
- "src/backend/**"
|
||||
pull_request:
|
||||
branches: [dev]
|
||||
paths:
|
||||
- "docker/**"
|
||||
- "poetry.lock"
|
||||
- "pyproject.toml"
|
||||
- "src/**"
|
||||
|
||||
env:
|
||||
POETRY_VERSION: "1.8.2"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build -t langflowai/langflow:latest-dev \
|
||||
-f docker/build_and_push.Dockerfile \
|
||||
.
|
||||
- name: Test image
|
||||
run: |
|
||||
expected_version=$(cat pyproject.toml | grep version | head -n 1 | cut -d '"' -f 2)
|
||||
version=$(docker run --rm --entrypoint bash langflowai/langflow:latest-dev -c 'python -c "from langflow.version import __version__ as langflow_version; print(langflow_version)"')
|
||||
if [ "$expected_version" != "$version" ]; then
|
||||
echo "Expected version: $expected_version"
|
||||
echo "Actual version: $version"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Build backend image
|
||||
run: |
|
||||
docker build -t langflowai/langflow-backend:latest-dev \
|
||||
--build-arg LANGFLOW_IMAGE=langflowai/langflow:latest-dev \
|
||||
-f docker/build_and_push_backend.Dockerfile \
|
||||
.
|
||||
- name: Test backend image
|
||||
run: |
|
||||
expected_version=$(cat pyproject.toml | grep version | head -n 1 | cut -d '"' -f 2)
|
||||
version=$(docker run --rm --entrypoint bash langflowai/langflow-backend:latest-dev -c 'python -c "from langflow.version import __version__ as langflow_version; print(langflow_version)"')
|
||||
if [ "$expected_version" != "$version" ]; then
|
||||
echo "Expected version: $expected_version"
|
||||
echo "Actual version: $version"
|
||||
exit 1
|
||||
fi
|
||||
- name: Build frontend image
|
||||
run: |
|
||||
docker build -t langflowai/langflow-frontend:latest-dev \
|
||||
-f docker/frontend/build_and_push_frontend.Dockerfile \
|
||||
.
|
||||
22
.github/workflows/pre-release-langflow.yml
vendored
22
.github/workflows/pre-release-langflow.yml
vendored
|
|
@ -82,6 +82,28 @@ jobs:
|
|||
tags: |
|
||||
langflowai/langflow:${{ needs.release.outputs.version }}
|
||||
langflowai/langflow:1.0-alpha
|
||||
- name: Build and push (frontend)
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: ./docker/frontend/build_and_push_frontend.Dockerfile
|
||||
tags: |
|
||||
langflowai/langflow-frontend:${{ needs.release.outputs.version }}
|
||||
langflowai/langflow-frontend:1.0-alpha
|
||||
- name: Wait for Docker Hub to propagate
|
||||
run: sleep 120
|
||||
- name: Build and push (backend)
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: ./docker/build_and_push_backend.Dockerfile
|
||||
build-args: |
|
||||
LANGFLOW_IMAGE=langflowai/langflow:${{ needs.release.outputs.version }}
|
||||
tags: |
|
||||
langflowai/langflow-backend:${{ needs.release.outputs.version }}
|
||||
langflowai/langflow-backend:1.0-alpha
|
||||
|
||||
create_release:
|
||||
name: Create Release
|
||||
|
|
|
|||
22
.github/workflows/release.yml
vendored
22
.github/workflows/release.yml
vendored
|
|
@ -54,6 +54,28 @@ jobs:
|
|||
tags: |
|
||||
langflowai/langflow:${{ steps.check-version.outputs.version }}
|
||||
langflowai/langflow:latest
|
||||
- name: Wait for Docker Hub to propagate
|
||||
run: sleep 120
|
||||
- name: Build and push (backend)
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: ./docker/build_and_push_backend.Dockerfile
|
||||
build-args: |
|
||||
LANGFLOW_IMAGE=langflowai/langflow:${{ steps.check-version.outputs.version }}
|
||||
tags: |
|
||||
langflowai/langflow-backend:${{ steps.check-version.outputs.version }}
|
||||
langflowai/langflow-backend:latest
|
||||
- name: Build and push (frontend)
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
file: ./docker/frontend/build_and_push_frontend.Dockerfile
|
||||
tags: |
|
||||
langflowai/langflow-frontend:${{ steps.check-version.outputs.version }}
|
||||
langflowai/langflow-frontend:latest
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue