Update dependencies and workflows (#2185)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-06-15 06:02:08 -07:00 committed by GitHub
commit 5191638f8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 61 additions and 7 deletions

View file

@ -52,14 +52,33 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push Base Image
- name: Build Docker Image
uses: docker/build-push-action@v5
id: docker_build
with:
context: .
push: false # Do not push yet
platforms: "linux/amd64,linux/arm64/v8"
file: ${{ matrix.file }}
tags: ${{ needs.setup.outputs.tags }}
- name: Run Container
run: |
docker run -d --name test_container -p 8000:8000 ${{ needs.setup.outputs.tags }}
- name: Wait for Container to Start
run: |
timeout 40 bash -c 'until curl -f http://127.0.0.1:8000/health; do sleep 1; done' || (echo "Server did not start in time" && docker logs test_container && docker stop test_container && docker rm test_container && exit 1)
- name: Stop and Remove Container
run: |
docker stop test_container
docker rm test_container
- name: Push Docker Image
if: success()
uses: docker/build-push-action@v5
with:
context: .
push: true
push: true # Push only if the tests pass
platforms: "linux/amd64,linux/arm64/v8"
file: ${{ matrix.file }}
# base_rags if release_type is base, main_tags if release_type is main
tags: ${{ needs.setup.outputs.tags }}

View file

@ -62,6 +62,27 @@ jobs:
else
make build main=true
fi
- name: Test CLI
run: |
if [ "${{ inputs.release_type }}" == "base" ]; then
pip install src/backend/base/dist/*.whl
else
pip install dist/*.whl
fi
langflow run --host 127.0.0.1 --port 7860 &
SERVER_PID=$!
# Wait for the server to start
timeout 40 bash -c 'until curl -f http://127.0.0.1:7860/health; do sleep 1; done' || (echo "Server did not start in time" && kill $SERVER_PID && exit 1)
# Terminate the server
kill $SERVER_PID || (echo "Failed to terminate the server" && exit 1)
sleep 10 # give the server some time to terminate
# Check if the server is still running
if kill -0 $SERVER_PID 2>/dev/null; then
echo "Failed to terminate the server"
exit 1
else
echo "Server terminated successfully"
fi
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }}