Skip to content

Commit

Permalink
fixed latest/lowest ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bracesproul committed Jun 11, 2024
1 parent 4b41efd commit 1227c69
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 55 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ jobs:
- name: Test `@langchain/anthropic` with lowest deps
run: docker compose -f dependency_range_tests/docker-compose.yml run anthropic-lowest-deps

# VertexAI
vertexai-latest-deps:
# Google VertexAI
google-vertexai-latest-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -162,10 +162,14 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build `@langchain/standard-tests`
run: yarn build --filter=@langchain/standard-tests
- name: Test `@langchain/google-vertexai` with latest deps
run: docker compose -f dependency_range_tests/docker-compose.yml run vertexai-latest-deps
run: docker compose -f dependency_range_tests/docker-compose.yml run google-vertexai-latest-deps

vertexai-lowest-deps:
google-vertexai-lowest-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -174,5 +178,9 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
cache: "yarn"
- name: Install dependencies
run: yarn install --immutable
- name: Build `@langchain/standard-tests`
run: yarn build --filter=@langchain/standard-tests
- name: Test `@langchain/google-vertexai` with lowest deps
run: docker compose -f dependency_range_tests/docker-compose.yml run vertexai-lowest-deps
run: docker compose -f dependency_range_tests/docker-compose.yml run google-vertexai-lowest-deps
19 changes: 13 additions & 6 deletions dependency_range_tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,25 +114,32 @@ services:
- ./scripts:/scripts
command: bash /scripts/with_standard_tests/anthropic/test-with-lowest-deps.sh

# VertexAI
vertexai-latest-deps:
# Google VertexAI
google-vertexai-latest-deps:
image: node:18
environment:
PUPPETEER_SKIP_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
COHERE_API_KEY: ${COHERE_API_KEY}
working_dir: /app
volumes:
- ../turbo.json:/turbo.json
- ../package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/langchain-google-vertexai:/libs/langchain-google-vertexai
- ./scripts:/scripts
command: bash /scripts/vertexai/test-with-latest-deps.sh
vertexai-lowest-deps:
command: bash /scripts/with_standard_tests/google-vertexai/test-with-latest-deps.sh
google-vertexai-lowest-deps:
image: node:18
environment:
PUPPETEER_SKIP_DOWNLOAD: "true"
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"
COHERE_API_KEY: ${COHERE_API_KEY}
working_dir: /app
volumes:
- ../turbo.json:/turbo.json
- ../package.json:/package.json
- ../libs/langchain-standard-tests:/libs/langchain-standard-tests
- ../libs/langchain-google-vertexai:/libs/langchain-google-vertexai
- ./scripts:/scripts
command: bash /scripts/vertexai/test-with-lowest-deps.sh

command: bash /scripts/with_standard_tests/google-vertexai/test-with-lowest-deps.sh
16 changes: 0 additions & 16 deletions dependency_range_tests/scripts/vertexai/test-with-latest-deps.sh

This file was deleted.

27 changes: 0 additions & 27 deletions dependency_range_tests/scripts/vertexai/test-with-lowest-deps.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const fs = require("fs");
const semver = require("semver");

const communityPackageJsonPath = "package.json";
const communityPackageJsonPath = "/app/monorepo/libs/langchain-google-vertexai/package.json";

const currentPackageJson = JSON.parse(fs.readFileSync(communityPackageJsonPath));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -euxo pipefail

export CI=true

# New monorepo directory paths
monorepo_dir="/app/monorepo"
monorepo_openai_dir="/app/monorepo/libs/langchain-google-vertexai"

# Run the shared script to copy all necessary folders/files
bash /scripts/with_standard_tests/shared.sh google-vertexai

# Navigate back to monorepo root and install dependencies
cd "$monorepo_dir"
yarn

# Navigate into `@langchain/google-vertexai` to build and run tests
# We need to run inside the google-vertexai directory so turbo repo does
# not try to build the package/its workspace dependencies.
cd "$monorepo_openai_dir"
yarn test
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

set -euxo pipefail

export CI=true

monorepo_dir="/app/monorepo"
monorepo_openai_dir="/app/monorepo/libs/langchain-google-vertexai"
updater_script_dir="/app/updater_script"
updater_script_dir="/app/updater_script"
original_updater_script_dir="/scripts/with_standard_tests/google-vertexai/node"

# Run the shared script to copy all necessary folders/files
bash /scripts/with_standard_tests/shared.sh google-vertexai

# Copy the updater script to the monorepo
mkdir -p "$updater_script_dir"
cp "$original_updater_script_dir"/* "$updater_script_dir/"

# Install deps (e.g semver) for the updater script
cd "$updater_script_dir"
yarn
# Run the updater script
node "update_resolutions_lowest.js"


# Navigate back to monorepo root and install dependencies
cd "$monorepo_dir"
yarn

# Navigate into `@langchain/package` to build and run tests
# We need to run inside the package directory so turbo repo does
# not try to build the package/its workspace dependencies.
cd "$monorepo_openai_dir"
yarn test

0 comments on commit 1227c69

Please sign in to comment.