Skip to content

Commit

Permalink
Merge branch 'v1.0.19.2' of github.com:langflow-ai/langflow into v1.0…
Browse files Browse the repository at this point in the history
….19.2
  • Loading branch information
Cristhianzl committed Nov 5, 2024
2 parents 07fe58b + 23156c7 commit 4546a98
Show file tree
Hide file tree
Showing 73 changed files with 604 additions and 236 deletions.
71 changes: 12 additions & 59 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version-input.outputs.version || steps.get-version-base.outputs.version || steps.get-version-main.outputs.version }}
version-no-v: ${{ steps.get-version-input.outputs.version_no_v || steps.get-version-base.outputs.version_no_v || steps.get-version-main.outputs.version_no_v }}
nightly-tag: ${{ steps.resolve-nightly-tag.outputs.nightly_tag }}
nightly-build: ${{ steps.resolve-nightly-tag.outputs.nightly_build }}
steps:
Expand Down Expand Up @@ -101,7 +100,7 @@ jobs:
- name: Check out the code at a specific ref
uses: actions/checkout@v4
with:
ref: ${{ inputs.version || inputs.nightly_tag_main || github.ref }}
ref: ${{ inputs.nightly_tag_main || github.ref }}
persist-credentials: true

- name: "Setup Environment"
Expand All @@ -111,7 +110,6 @@ jobs:
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."
Expand All @@ -136,23 +134,6 @@ jobs:
echo "base nightly version=${{ inputs.nightly_tag_base }}"
echo "building image for nightly_version=${{ steps.resolve-nightly-tag.outputs.nightly-tag }}"
version=${{ inputs.nightly_tag_main }}
echo version=$version
echo version=$version >> $GITHUB_OUTPUT
# strip leading v
version=${version#v}
echo version_no_v=$version
echo version_no_v=$version >> $GITHUB_OUTPUT
elif [[ "${{ inputs.version }}" != '' ]]; then
version=${{ inputs.version }}
echo version=$version
echo version=$version >> $GITHUB_OUTPUT
# strip leading v
version=${version#v}
echo version_no_v=$version
echo version_no_v=$version >> $GITHUB_OUTPUT
# Strip leading v from nightly tag main if present
version=${{ inputs.nightly_tag_main }}
version=${version#v}
Expand All @@ -171,31 +152,20 @@ jobs:
if: ${{ inputs.version == '' && inputs.release_type == 'base' }}
id: get-version-base
run: |
version=$(uv tree | grep 'langflow-base' | awk '{print $3}')
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
# strip leading v
version=${version#v}
echo version_no_v=$version
echo version_no_v=$version >> $GITHUB_OUTPUT
- name: Get Version Main
if: ${{ inputs.version == '' && (inputs.release_type == 'main' || inputs.release_type == 'main-ep') }}
id: get-version-main
run: |
version=$(uv tree | grep 'langflow' | grep -v 'langflow-base' | awk '{print $2}')
version=$(uv tree | grep 'langflow' | grep -v 'langflow-base' | awk '{print $2}' | sed 's/^v//')
echo version=$version
echo version=$version >> $GITHUB_OUTPUT
# strip leading v
version=${version#v}
echo version_no_v=$version
echo version_no_v=$version >> $GITHUB_OUTPUT
setup:
runs-on: ubuntu-latest
needs: get-version
Expand All @@ -214,28 +184,12 @@ jobs:
if [[ "${{ inputs.release_type }}" == "base" ]]; then
# LANGFLOW-BASE RELEASE
echo "docker_tags=langflowai/langflow${nightly_suffix}:base-${{ needs.get-version.outputs.version-no-v }},langflowai/langflow${nightly_suffix}:base-latest" >> $GITHUB_OUTPUT
echo "ghcr_tags=ghcr.io/langflow-ai/langflow${nightly_suffix}:base-${{ needs.get-version.outputs.version-no-v }},ghcr.io/langflow-ai/langflow${nightly_suffix}:base-latest" >> $GITHUB_OUTPUT
echo "docker_tags=langflowai/langflow${nightly_suffix}:base-${{ needs.get-version.outputs.version }},langflowai/langflow${nightly_suffix}:base-latest" >> $GITHUB_OUTPUT
echo "ghcr_tags=ghcr.io/langflow-ai/langflow${nightly_suffix}:base-${{ needs.get-version.outputs.version }},ghcr.io/langflow-ai/langflow${nightly_suffix}:base-latest" >> $GITHUB_OUTPUT
echo "file=./docker/build_and_push_base.Dockerfile" >> $GITHUB_OUTPUT
else
if [[ "${{ inputs.pre_release }}" == "true" ]]; then
# LANGFLOW-MAIN PRE-RELEASE
echo "docker_tags=langflowai/langflow${nightly_suffix}:${{ needs.get-version.outputs.version-no-v }}" >> $GITHUB_OUTPUT
echo "ghcr_tags=ghcr.io/langflow-ai/langflow${nightly_suffix}:${{ needs.get-version.outputs.version-no-v }}" >> $GITHUB_OUTPUT
echo "file=./docker/build_and_push.Dockerfile" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.release_type }}" == "main-ep" ]]; then
# LANGFLOW-MAIN (ENTRYPOINT) RELEASE
echo "docker_tags=langflowai/langflow-ep${nightly_suffix}:${{ needs.get-version.outputs.version-no-v }},langflowai/langflow-ep${nightly_suffix}:latest" >> $GITHUB_OUTPUT
echo "ghcr_tags=ghcr.io/langflow-ai/langflow-ep${nightly_suffix}:${{ needs.get-version.outputs.version-no-v }},ghcr.io/langflow-ai/langflow-ep${nightly_suffix}:latest" >> $GITHUB_OUTPUT
echo "file=./docker/build_and_push_ep.Dockerfile" >> $GITHUB_OUTPUT
elif [[ "${{ inputs.release_type }}" == "main" ]]; then
# LANGFLOW-MAIN RELEASE
echo "docker_tags=langflowai/langflow${nightly_suffix}:${{ needs.get-version.outputs.version-no-v }},langflowai/langflow${nightly_suffix}:latest" >> $GITHUB_OUTPUT
echo "ghcr_tags=ghcr.io/langflow-ai/langflow${nightly_suffix}:${{ needs.get-version.outputs.version-no-v }},ghcr.io/langflow-ai/langflow${nightly_suffix}:latest" >> $GITHUB_OUTPUT
echo "file=./docker/build_and_push.Dockerfile" >> $GITHUB_OUTPUT
else
echo "docker_tags=langflowai/langflow${nightly_suffix}:${{ needs.get-version.outputs.version }}" >> $GITHUB_OUTPUT
echo "ghcr_tags=ghcr.io/langflow-ai/langflow${nightly_suffix}:${{ needs.get-version.outputs.version }}" >> $GITHUB_OUTPUT
echo "file=./docker/build_and_push.Dockerfile" >> $GITHUB_OUTPUT
Expand All @@ -261,7 +215,6 @@ 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
Expand Down Expand Up @@ -321,25 +274,25 @@ jobs:
include:
- component: docker-backend
dockerfile: ./docker/build_and_push_backend.Dockerfile
tags: ${{ inputs.pre_release == 'true' && format('langflowai/langflow-backend{0}:{1}', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version-no-v) || format('langflowai/langflow-backend{0}:{1},langflowai/langflow-backend{0}:latest', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version-no-v) }}
langflow_image: langflowai/langflow${{ needs.get-version.outputs.nightly-build && '-nightly' || '' }}:${{ needs.get-version.outputs.version-no-v }}
tags: ${{ inputs.pre_release == 'true' && format('langflowai/langflow-backend{0}:{1}', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version) || format('langflowai/langflow-backend{0}:{1},langflowai/langflow-backend{0}:latest', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version) }}
langflow_image: langflowai/langflow${{ needs.get-version.outputs.nightly-build && '-nightly' || '' }}:${{ needs.get-version.outputs.version }}
- component: docker-frontend
dockerfile: ./docker/frontend/build_and_push_frontend.Dockerfile
tags: ${{ inputs.pre_release == 'true' && format('langflowai/langflow-frontend{0}:{1}', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version-no-v) || format('langflowai/langflow-frontend{0}:{1},langflowai/langflow-frontend{0}:latest', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version-no-v) }}
langflow_image: langflowai/langflow${{ needs.get-version.outputs.nightly-build && '-nightly' || '' }}:${{ needs.get-version.outputs.version-no-v }}
tags: ${{ inputs.pre_release == 'true' && format('langflowai/langflow-frontend{0}:{1}', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version) || format('langflowai/langflow-frontend{0}:{1},langflowai/langflow-frontend{0}:latest', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version) }}
langflow_image: langflowai/langflow${{ needs.get-version.outputs.nightly-build && '-nightly' || '' }}:${{ needs.get-version.outputs.version }}
- component: ghcr-backend
dockerfile: ./docker/build_and_push_backend.Dockerfile
tags: ${{ format('ghcr.io/langflow-ai/langflow-backend{0}:{1},ghcr.io/langflow-ai/langflow-backend{0}:latest', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version-no-v) }}
langflow_image: ghcr.io/langflow-ai/langflow${{ needs.get-version.outputs.nightly-build && '-nightly' || '' }}:${{ needs.get-version.outputs.version-no-v }}
tags: ${{ format('ghcr.io/langflow-ai/langflow-backend{0}:{1},ghcr.io/langflow-ai/langflow-backend{0}:latest', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version) }}
langflow_image: ghcr.io/langflow-ai/langflow${{ needs.get-version.outputs.nightly-build && '-nightly' || '' }}:${{ needs.get-version.outputs.version }}
- component: ghcr-frontend
dockerfile: ./docker/frontend/build_and_push_frontend.Dockerfile
tags: ${{ format('ghcr.io/langflow-ai/langflow-frontend{0}:{1},ghcr.io/langflow-ai/langflow-frontend{0}:latest', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version-no-v) }}
langflow_image: ghcr.io/langflow-ai/langflow${{ needs.get-version.outputs.nightly-build && '-nightly' || '' }}:${{ needs.get-version.outputs.version-no-v }}
tags: ${{ format('ghcr.io/langflow-ai/langflow-frontend{0}:{1},ghcr.io/langflow-ai/langflow-frontend{0}:latest', needs.get-version.outputs.nightly-build && '-nightly' || '', needs.get-version.outputs.version) }}
langflow_image: ghcr.io/langflow-ai/langflow${{ needs.get-version.outputs.nightly-build && '-nightly' || '' }}:${{ needs.get-version.outputs.version }}
steps:
- 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
Expand Down Expand Up @@ -387,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

Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/release_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,6 @@ 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
Expand All @@ -240,4 +231,4 @@ jobs:
# with:
# release_type: main-ep
# nightly_tag_main: ${{ inputs.nightly_tag_main }}
# secrets: inherit
# secrets: inherit
2 changes: 1 addition & 1 deletion src/backend/base/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ build-backend = "hatchling.build"

[project]
name = "langflow-base"
version = "0.0.98"
version = "0.0.99"
description = "A Python package with a built-in web application"
requires-python = ">=3.10,<3.13"
license = "MIT"
Expand Down
10 changes: 5 additions & 5 deletions src/backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
from dotenv import load_dotenv
from fastapi.testclient import TestClient
from httpx import ASGITransport, AsyncClient
from loguru import logger
from sqlmodel import Session, SQLModel, create_engine, select
from sqlmodel.pool import StaticPool
from typer.testing import CliRunner

from langflow.graph import Graph
from langflow.initial_setup.setup import STARTER_FOLDER_NAME
from langflow.services.auth.utils import get_password_hash
Expand All @@ -32,6 +27,11 @@
from langflow.services.database.models.vertex_builds.crud import delete_vertex_builds_by_flow_id
from langflow.services.database.utils import session_getter
from langflow.services.deps import get_db_service
from loguru import logger
from sqlmodel import Session, SQLModel, create_engine, select
from sqlmodel.pool import StaticPool
from typer.testing import CliRunner

from tests import blockbuster
from tests.api_keys import get_openai_api_key

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from langflow.schema.message import Message

from tests.api_keys import get_openai_api_key
from tests.integration.utils import download_flow_from_github, run_json_flow

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import pytest
from astrapy.db import AstraDB
from langchain_core.documents import Document

from langflow.components.embeddings import OpenAIEmbeddingsComponent
from langflow.components.vectorstores import AstraVectorStoreComponent
from langflow.schema.data import Data

from tests.api_keys import get_astradb_api_endpoint, get_astradb_application_token, get_openai_api_key
from tests.integration.components.mock_components import TextToData
from tests.integration.utils import ComponentInputHandle, run_single_component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from langflow.components.helpers import ParseJSONDataComponent
from langflow.components.inputs import ChatInput
from langflow.schema import Data

from tests.integration.components.mock_components import TextToData
from tests.integration.utils import ComponentInputHandle, run_single_component

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from langflow.components.inputs import ChatInput
from langflow.memory import get_messages
from langflow.schema.message import Message

from tests.integration.utils import run_single_component


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from langflow.components.inputs import TextInputComponent
from langflow.schema.message import Message

from tests.integration.utils import run_single_component


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os

import pytest

from langflow.components.models import OpenAIModelComponent
from langflow.components.output_parsers import OutputParserComponent
from langflow.components.prompts import PromptComponent

from tests.integration.utils import ComponentInputHandle, run_single_component


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from langflow.components.outputs import ChatOutput
from langflow.memory import get_messages
from langflow.schema.message import Message

from tests.integration.utils import run_single_component


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from langflow.components.outputs import TextOutputComponent
from langflow.schema.message import Message

from tests.integration.utils import run_single_component


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from langflow.components.prompts import PromptComponent
from langflow.schema.message import Message

from tests.integration.utils import run_single_component


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from langflow.components.prompts import PromptComponent
from langflow.graph import Graph
from langflow.schema.message import Message

from tests.integration.utils import run_flow


Expand Down
1 change: 0 additions & 1 deletion src/backend/tests/integration/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import pytest
from fastapi import status
from httpx import AsyncClient

from langflow.graph.schema import RunOutputs
from langflow.initial_setup.setup import load_starter_projects
from langflow.load import run_flow_from_json
Expand Down
1 change: 0 additions & 1 deletion src/backend/tests/integration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import requests
from astrapy.admin import parse_api_endpoint

from langflow.api.v1.schemas import InputValueRequest
from langflow.custom import Component
from langflow.field_typing import Embeddings
Expand Down
1 change: 0 additions & 1 deletion src/backend/tests/performance/test_server_init.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import asyncio

import pytest

from langflow.services.deps import get_settings_service


Expand Down
1 change: 0 additions & 1 deletion src/backend/tests/unit/api/v1/test_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from fastapi import status
from httpx import AsyncClient

from langflow.api.v1.schemas import UpdateCustomComponentRequest


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

import pytest

from langflow.base.tools.component_tool import ComponentToolkit
from langflow.components.agents import ToolCallingAgentComponent
from langflow.components.inputs import ChatInput
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

import pytest

from langflow.components.agents.agent import AgentComponent
from langflow.components.tools.calculator import CalculatorToolComponent

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os

import pytest

from langflow.components.agents.tool_calling import ToolCallingAgentComponent
from langflow.components.models.openai import OpenAIModelComponent
from langflow.components.tools.calculator import CalculatorToolComponent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import pytest
from langchain_core.language_models import BaseLanguageModel
from pydantic import BaseModel
from typing_extensions import override

from langflow.components.helpers.structured_output import StructuredOutputComponent
from langflow.schema.data import Data
from pydantic import BaseModel
from typing_extensions import override


class TestStructuredOutputComponent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import pytest
from langchain_ollama import ChatOllama

from langflow.components.models import ChatOllamaComponent


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from langflow.inputs.inputs import DictInput, DropdownInput, FloatInput, HandleInput, IntInput, SecretStrInput, StrInput

from src.backend.base.langflow.components.models.huggingface import HuggingFaceEndpointsComponent


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest

from langflow.components.prototypes import CreateDataComponent
from langflow.schema import Data

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest

from langflow.components.prototypes import UpdateDataComponent
from langflow.schema import Data

Expand Down
Loading

0 comments on commit 4546a98

Please sign in to comment.