Skip to content

Commit

Permalink
Revert workflows, remove CLI in x-codeSamples (#1945)
Browse files Browse the repository at this point in the history
  • Loading branch information
NolanTrem authored Feb 7, 2025
1 parent 6f44ddf commit bec15fc
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 387 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-python-full/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
python-version: ${{ inputs.python-version }}
cache: 'pip'

- name: Install Python SDK
- name: Install R2R CLI & Python SDK
shell: bash
run: |
if [ "${{ inputs.r2r-version }}" = "latest" ]; then
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/start-r2r-full/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ runs:
shell: bash
run: |
cd py
docker compose -f r2r/compose.full.yaml --project-name r2r-full up -d
poetry run r2r serve --docker --full --config-name=full_azure --build --image=r2r-local
15 changes: 1 addition & 14 deletions .github/actions/start-r2r-light/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,8 @@ runs:
steps:
- name: Start R2R server
shell: bash
env:
PYTHONWARNINGS: "ignore::UserWarning"
PYTHONPATH: "/app"
run: |
cd py
export R2R_CONFIG_NAME=r2r_azure_with_test_limits
docker build -t r2r/test .
docker compose -f r2r/compose.yaml --project-name r2r --profile postgres up -d
poetry run r2r serve --config-name=r2r_azure_with_test_limits &
echo "Waiting for services to start..."
sleep 30
echo "R2R Container Logs:"
docker logs r2r-r2r-1
curl http://localhost:7272/v3/health || echo "Server not responding"
18 changes: 13 additions & 5 deletions .github/workflows/r2r-js-sdk-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
uses: ./.github/actions/setup-python-light
with:
os: ubuntu-latest
- name: Setup and start PostgreSQL
uses: ./.github/actions/setup-postgres-ext
with:
os: ubuntu-latest
- name: Start R2R Light server
uses: ./.github/actions/start-r2r-light
- name: Use Node.js
uses: actions/setup-node@v2
with:
Expand All @@ -26,11 +32,9 @@ jobs:
- name: Install JS SDK dependencies
working-directory: ./js/sdk
run: pnpm install
- name: Lint and Build JS SDK
- name: Check if R2R server is running
run: |
cd js/sdk
pnpm format
pnpm build
curl http://localhost:7272/v2/health || echo "Server not responding"
v3-integration-tests:
needs: setup
Expand All @@ -56,7 +60,7 @@ jobs:
AZURE_API_BASE: ${{ secrets.AZURE_API_BASE }}
AZURE_API_VERSION: ${{ secrets.AZURE_API_VERSION }}
TELEMETRY_ENABLED: 'false'
R2R_POSTGRES_HOST: host.docker.internal
R2R_POSTGRES_HOST: localhost
R2R_POSTGRES_DBNAME: postgres
R2R_POSTGRES_PORT: '5432'
R2R_POSTGRES_PASSWORD: postgres
Expand All @@ -68,6 +72,10 @@ jobs:
uses: ./.github/actions/setup-python-light
with:
os: ubuntu-latest
- name: Setup and start PostgreSQL
uses: ./.github/actions/setup-postgres-ext
with:
os: ubuntu-latest
- name: Start R2R Light server
uses: ./.github/actions/start-r2r-light
- name: Use Node.js
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/r2r-light-py-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
AZURE_API_BASE: ${{ secrets.AZURE_API_BASE }}
AZURE_API_VERSION: ${{ secrets.AZURE_API_VERSION }}
TELEMETRY_ENABLED: 'false'
R2R_POSTGRES_HOST: host.docker.internal
R2R_POSTGRES_HOST: localhost
R2R_POSTGRES_DBNAME: postgres
R2R_POSTGRES_PORT: '5432'
R2R_POSTGRES_PASSWORD: postgres
Expand Down
9 changes: 2 additions & 7 deletions py/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

RUN pip install --no-cache-dir poetry==1.8.4
RUN pip install --no-cache-dir poetry


# Add Rust to PATH
Expand All @@ -20,8 +20,7 @@ COPY pyproject.toml /app/py/pyproject.toml
# Install dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --extras "core ingestion-bundle" --no-root \
&& pip install --no-cache-dir gunicorn uvicorn \
&& python -c "import lark"
&& pip install --no-cache-dir gunicorn uvicorn

# Create the final image
FROM python:3.12-slim
Expand All @@ -44,8 +43,6 @@ WORKDIR /app
COPY --from=builder /usr/local/lib/python3.12/site-packages /usr/local/lib/python3.12/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin

RUN python -c "import lark"

# Expose the port and set environment variables
ARG R2R_PORT=8000 R2R_HOST=0.0.0.0
ENV R2R_PORT=$R2R_PORT R2R_HOST=$R2R_HOST
Expand All @@ -59,7 +56,5 @@ COPY shared /app/shared
COPY r2r/r2r.toml /app/r2r.toml
COPY pyproject.toml /app/pyproject.toml

RUN python -c "import lark"

# Run the application
CMD ["sh", "-c", "uvicorn core.main.app_entry:app --host $R2R_HOST --port $R2R_PORT"]
55 changes: 0 additions & 55 deletions py/core/main/api/v3/collections_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,6 @@ def _setup_routes(self):
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r collections create "My New Collection" --description="This is a sample collection"
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -240,13 +232,6 @@ async def create_collection(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -341,14 +326,6 @@ async def export_collections(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r collections list
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -447,14 +424,6 @@ async def list_collections(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r collections retrieve 123e4567-e89b-12d3-a456-426614174000
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -634,14 +603,6 @@ async def update_collection(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r collections delete 123e4567-e89b-12d3-a456-426614174000
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -792,14 +753,6 @@ async def add_document_to_collection(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r collections list-documents 123e4567-e89b-12d3-a456-426614174000
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -971,14 +924,6 @@ async def remove_document_from_collection(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r collections list-users 123e4567-e89b-12d3-a456-426614174000
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down
54 changes: 0 additions & 54 deletions py/core/main/api/v3/conversations_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,6 @@ def _setup_routes(self):
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r conversations create
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -145,14 +137,6 @@ async def create_conversation(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r conversations list
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -252,13 +236,6 @@ async def list_conversations(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -358,13 +335,6 @@ async def export_conversations(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -460,14 +430,6 @@ async def export_messages(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r conversations retrieve 123e4567-e89b-12d3-a456-426614174000
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -540,14 +502,6 @@ async def get_conversation(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r conversations delete 123e4567-e89b-12d3-a456-426614174000
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down Expand Up @@ -622,14 +576,6 @@ async def update_conversation(
"""
),
},
{
"lang": "CLI",
"source": textwrap.dedent(
"""
r2r conversations delete 123e4567-e89b-12d3-a456-426614174000
"""
),
},
{
"lang": "cURL",
"source": textwrap.dedent(
Expand Down
Loading

0 comments on commit bec15fc

Please sign in to comment.