-
Notifications
You must be signed in to change notification settings - Fork 34
Feature/retrieval chain workflows #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e178038
added retrieval-chain workflow
giuliastf 9b097a6
test for retrieval-chain workflow
giuliastf 6f1b4af
aaa
giuliastf 6f79fb8
asdasds
giuliastf 8e48c99
Added Dockerfile
giuliastf 4e94110
Added Dockerfile
giuliastf 0c36138
abc
giuliastf 109ddb9
aha
giuliastf f2cc0e2
abcde
giuliastf 6854b7f
Dockerfile for company research agent
giuliastf 3206b29
asdf
giuliastf f9c2764
bun
giuliastf 17295ec
ABC
giuliastf ff5c718
aaaaaaa
giuliastf 953feac
aaaaaaa
giuliastf f809bbd
DSGH
giuliastf d5119c9
dsvg\ad
giuliastf 5878529
fdnbthjtd
giuliastf 41c9b97
;/kvh; vg
giuliastf f0e60cb
Revert " ;/kvh; vg"
giuliastf ff0bdd7
fdsgz
giuliastf 0d41347
help
giuliastf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| name: Integration testing | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| test-retrieval-chain: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow Medium
Unpinned 3rd party Action 'Integration testing' step
Uses Step Error loading related location Loading |
||
|
|
||
| - name: Build Docker image | ||
| run: | | ||
| docker build -t retrieval-chain:test \ | ||
| --build-arg CLIENT_ID="${{ secrets.ALPHA_TEST_CLIENT_ID }}" \ | ||
| --build-arg CLIENT_SECRET="${{ secrets.ALPHA_TEST_CLIENT_SECRET }}" \ | ||
| --build-arg BASE_URL="${{ secrets.ALPHA_BASE_URL }}" \ | ||
| . | ||
| working-directory: ./samples/company-research-agent | ||
| # env: | ||
| # ALPHA_BASE_URL: ${{ secrets.ALPHA_BASE_URL }} | ||
|
|
||
| - name: Test retrieval chain with default parameters | ||
| run: | | ||
| cd samples/retrieval-chain | ||
| docker run --rm \ | ||
| -e CLIENT_ID="${{ secrets.UIPATH_CLIENT_ID }}" \ | ||
| -e CLIENT_SECRET="${{ secrets.UIPATH_CLIENT_SECRET }}" \ | ||
| -e BASE_URL="${{ secrets.UIPATH_BASE_URL }}" \ | ||
| retrieval-chain:test | ||
|
|
||
| - name: Test retrieval chain with custom parameters | ||
| if: github.event_name == 'workflow_dispatch' | ||
| run: | | ||
| cd samples/retrieval-chain | ||
| docker run --rm \ | ||
| -e CLIENT_ID="${{ secrets.UIPATH_CLIENT_ID }}" \ | ||
| -e CLIENT_SECRET="${{ secrets.UIPATH_CLIENT_SECRET }}" \ | ||
| -e BASE_URL="${{ secrets.UIPATH_BASE_URL }}" \ | ||
| retrieval-chain:test \ | ||
| /app/startup.sh --index_name "${{ github.event.inputs.index_name }}" --query "${{ github.event.inputs.query }}" --k ${{ github.event.inputs.k }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| name: Test Retrieval Chain | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| index_name: | ||
| description: 'Index name to query' | ||
| required: true | ||
| default: 'ECCN' | ||
| query: | ||
| description: 'Query to search for' | ||
| required: true | ||
| default: 'What is the ECCN for a laptop?' | ||
| k: | ||
| description: 'Number of results to return' | ||
| required: false | ||
| default: '3' | ||
|
|
||
| jobs: | ||
| run-retrieval-chain: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build and run retrieval chain | ||
| run: | | ||
| cd samples/retrieval-chain | ||
|
|
||
| # Build the image | ||
| docker build -t retrieval-chain \ | ||
| --build-arg CLIENT_ID="${{ secrets.UIPATH_CLIENT_ID }}" \ | ||
| --build-arg CLIENT_SECRET="${{ secrets.UIPATH_CLIENT_SECRET }}" \ | ||
| --build-arg BASE_URL="${{ secrets.UIPATH_BASE_URL }}" \ | ||
| . | ||
|
|
||
| # Run with parameters | ||
| docker run --rm \ | ||
| -e CLIENT_ID="${{ secrets.UIPATH_CLIENT_ID }}" \ | ||
| -e CLIENT_SECRET="${{ secrets.UIPATH_CLIENT_SECRET }}" \ | ||
| -e BASE_URL="${{ secrets.UIPATH_BASE_URL }}" \ | ||
| retrieval-chain \ | ||
| /app/startup.sh --index_name "${{ github.event.inputs.index_name }}" --query "${{ github.event.inputs.query }}" --k ${{ github.event.inputs.k }} | ||
|
|
||
| - name: Show completion | ||
| run: | | ||
| echo "✅ Retrieval chain completed successfully!" | ||
| echo "📊 Parameters used:" | ||
| echo " - Index: ${{ github.event.inputs.index_name }}" | ||
| echo " - Query: ${{ github.event.inputs.query }}" | ||
| echo " - Results: ${{ github.event.inputs.k }}" | ||
|
Comment on lines
+21
to
+52
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium test
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
88 changes: 88 additions & 0 deletions
88
samples/company-research-agent/.github/workflows/ci-cd.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| name: Build and Deploy Company Research Agent | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| paths: | ||
| - 'samples/company-research-agent/**' | ||
| pull_request: | ||
| branches: [ main ] | ||
| paths: | ||
| - 'samples/company-research-agent/**' | ||
|
|
||
| env: | ||
| REGISTRY: ghcr.io | ||
| IMAGE_NAME: ${{ github.repository }}/company-research-agent | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Log in to Container Registry | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: ${{ env.REGISTRY }} | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Extract metadata | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
| tags: | | ||
| type=ref,event=branch | ||
| type=ref,event=pr | ||
| type=sha,prefix=sha- | ||
|
|
||
| - name: Build and push Docker image | ||
| uses: docker/build-push-action@v5 | ||
| with: | ||
| context: ./samples/company-research-agent | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| build-args: | | ||
| CLIENT_ID=${{ secrets.UIPATH_CLIENT_ID }} | ||
| CLIENT_SECRET=${{ secrets.UIPATH_CLIENT_SECRET }} | ||
| BASE_URL=${{ secrets.UIPATH_BASE_URL }} | ||
| ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }} | ||
| TAVILY_API_KEY=${{ secrets.TAVILY_API_KEY }} | ||
|
|
||
| test: | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run container tests | ||
| run: | | ||
| docker run --rm \ | ||
| -e CLIENT_ID=${{ secrets.UIPATH_CLIENT_ID }} \ | ||
| -e CLIENT_SECRET=${{ secrets.UIPATH_CLIENT_SECRET }} \ | ||
| -e BASE_URL=${{ secrets.UIPATH_BASE_URL }} \ | ||
| -e ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }} \ | ||
| -e TAVILY_API_KEY=${{ secrets.TAVILY_API_KEY }} \ | ||
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }} \ | ||
| /bin/bash -c "echo 'Container health check passed'" | ||
|
|
||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| needs: [build, test] | ||
| if: github.ref == 'refs/heads/main' | ||
|
|
||
| steps: | ||
| - name: Deploy to production | ||
| run: | | ||
| echo "Deploying to production..." | ||
| # Add your deployment commands here | ||
| # For example, deploy to Azure Container Instances, AWS ECS, or Kubernetes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| FROM ghcr.io/astral-sh/uv:python3.12-bookworm | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| COPY . . | ||
|
|
||
| RUN uv sync | ||
|
|
||
| ARG CLIENT_ID | ||
| ARG CLIENT_SECRET | ||
| ARG BASE_URL | ||
|
|
||
| # Validate required environment variables | ||
| RUN if [ -z "$CLIENT_ID" ]; then echo "CLIENT_ID build arg is required" && exit 1; fi | ||
| RUN if [ -z "$CLIENT_SECRET" ]; then echo "CLIENT_SECRET build arg is required" && exit 1; fi | ||
| RUN if [ -z "$BASE_URL" ]; then echo "BASE_URL build arg is required" && exit 1; fi | ||
|
|
||
| # Set environment variables for runtime | ||
| ENV CLIENT_ID=$CLIENT_ID | ||
| ENV CLIENT_SECRET=$CLIENT_SECRET | ||
| ENV BASE_URL=$BASE_URL | ||
| ENV TAVILY_API_KEY=${TAVILY_API_KEY:-""} | ||
|
|
||
|
|
||
| # Authenticate with UiPath during build | ||
| RUN uv run uipath auth --client-id="$CLIENT_ID" --client-secret="$CLIENT_SECRET" --base-url="$BASE_URL" | ||
|
|
||
| RUN uv run uipath run agent '{"company_name":"uipath"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.