Skip to content

Commit d4ed985

Browse files
krrishdholakiarajatvigHexoplonyujongleehughcrt
authored
Add back in non root image fixes (#7781) (#7795)
* Add back in non root image fixes (#7781) * Add back in non root image fixes * Fix dockerfile * Fix perms * Add in container structure tests for the nonroot image (#7796) * feat(helm): add securityContext and pull policy values to migration job (#7652) * fix(helm): corrected indentation in migration-job.yaml * feat(helm): add securityContext and pull policy values to migration job * fix confusing save button label (#7778) * [integrations/lunary] Improve Lunary documentaiton (#7770) * update lunary doc * better title * tweaks * Update langchain.md * Update lunary_integration.md * Fix wrong URL for internal user invitation (#7762) * format * done * Update instructor tutorial (#7784) * Add in container structure tests for the nonroot image --------- Co-authored-by: Zackeus Bengtsson <[email protected]> Co-authored-by: yujonglee <[email protected]> Co-authored-by: Hugues Chocart <[email protected]> Co-authored-by: Nikolaiev Dmytro <[email protected]> --------- Co-authored-by: Rajat Vig <[email protected]> Co-authored-by: Zackeus Bengtsson <[email protected]> Co-authored-by: yujonglee <[email protected]> Co-authored-by: Hugues Chocart <[email protected]> Co-authored-by: Nikolaiev Dmytro <[email protected]>
1 parent 80d6bbe commit d4ed985

File tree

4 files changed

+128
-77
lines changed

4 files changed

+128
-77
lines changed

.circleci/config.yml

Lines changed: 80 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ jobs:
4747
pip install opentelemetry-api==1.25.0
4848
pip install opentelemetry-sdk==1.25.0
4949
pip install opentelemetry-exporter-otlp==1.25.0
50-
pip install openai==1.54.0
51-
pip install prisma==0.11.0
52-
pip install "detect_secrets==1.5.0"
50+
pip install openai==1.54.0
51+
pip install prisma==0.11.0
52+
pip install "detect_secrets==1.5.0"
5353
pip install "httpx==0.24.1"
5454
pip install "respx==0.21.1"
5555
pip install fastapi
@@ -165,9 +165,9 @@ jobs:
165165
pip install opentelemetry-api==1.25.0
166166
pip install opentelemetry-sdk==1.25.0
167167
pip install opentelemetry-exporter-otlp==1.25.0
168-
pip install openai==1.54.0
169-
pip install prisma==0.11.0
170-
pip install "detect_secrets==1.5.0"
168+
pip install openai==1.54.0
169+
pip install prisma==0.11.0
170+
pip install "detect_secrets==1.5.0"
171171
pip install "httpx==0.24.1"
172172
pip install "respx==0.21.1"
173173
pip install fastapi
@@ -264,9 +264,9 @@ jobs:
264264
pip install opentelemetry-api==1.25.0
265265
pip install opentelemetry-sdk==1.25.0
266266
pip install opentelemetry-exporter-otlp==1.25.0
267-
pip install openai==1.54.0
268-
pip install prisma==0.11.0
269-
pip install "detect_secrets==1.5.0"
267+
pip install openai==1.54.0
268+
pip install prisma==0.11.0
269+
pip install "detect_secrets==1.5.0"
270270
pip install "httpx==0.24.1"
271271
pip install "respx==0.21.1"
272272
pip install fastapi
@@ -367,18 +367,18 @@ jobs:
367367
# Store test results
368368
- store_test_results:
369369
path: test-results
370-
370+
371371
- persist_to_workspace:
372372
root: .
373373
paths:
374374
- auth_ui_unit_tests_coverage.xml
375375
- auth_ui_unit_tests_coverage
376376
litellm_router_testing: # Runs all tests with the "router" keyword
377377
docker:
378-
- image: cimg/python:3.11
379-
auth:
380-
username: ${DOCKERHUB_USERNAME}
381-
password: ${DOCKERHUB_PASSWORD}
378+
- image: cimg/python:3.11
379+
auth:
380+
username: ${DOCKERHUB_USERNAME}
381+
password: ${DOCKERHUB_PASSWORD}
382382
working_directory: ~/project
383383

384384
steps:
@@ -417,10 +417,10 @@ jobs:
417417
- litellm_router_coverage
418418
litellm_proxy_unit_testing: # Runs all tests with the "proxy", "key", "jwt" filenames
419419
docker:
420-
- image: cimg/python:3.11
421-
auth:
422-
username: ${DOCKERHUB_USERNAME}
423-
password: ${DOCKERHUB_PASSWORD}
420+
- image: cimg/python:3.11
421+
auth:
422+
username: ${DOCKERHUB_USERNAME}
423+
password: ${DOCKERHUB_PASSWORD}
424424
working_directory: ~/project
425425
steps:
426426
- checkout
@@ -458,9 +458,9 @@ jobs:
458458
pip install opentelemetry-api==1.25.0
459459
pip install opentelemetry-sdk==1.25.0
460460
pip install opentelemetry-exporter-otlp==1.25.0
461-
pip install openai==1.54.0
462-
pip install prisma==0.11.0
463-
pip install "detect_secrets==1.5.0"
461+
pip install openai==1.54.0
462+
pip install prisma==0.11.0
463+
pip install "detect_secrets==1.5.0"
464464
pip install "httpx==0.24.1"
465465
pip install "respx==0.21.1"
466466
pip install fastapi
@@ -514,10 +514,10 @@ jobs:
514514
- litellm_proxy_unit_tests_coverage
515515
litellm_assistants_api_testing: # Runs all tests with the "assistants" keyword
516516
docker:
517-
- image: cimg/python:3.11
518-
auth:
519-
username: ${DOCKERHUB_USERNAME}
520-
password: ${DOCKERHUB_PASSWORD}
517+
- image: cimg/python:3.11
518+
auth:
519+
username: ${DOCKERHUB_USERNAME}
520+
password: ${DOCKERHUB_PASSWORD}
521521
working_directory: ~/project
522522

523523
steps:
@@ -616,7 +616,7 @@ jobs:
616616
command: |
617617
mv coverage.xml llm_translation_coverage.xml
618618
mv .coverage llm_translation_coverage
619-
619+
620620
# Store test results
621621
- store_test_results:
622622
path: test-results
@@ -660,7 +660,7 @@ jobs:
660660
command: |
661661
mv coverage.xml batches_coverage.xml
662662
mv .coverage batches_coverage
663-
663+
664664
# Store test results
665665
- store_test_results:
666666
path: test-results
@@ -704,7 +704,7 @@ jobs:
704704
command: |
705705
mv coverage.xml secret_manager_coverage.xml
706706
mv .coverage secret_manager_coverage
707-
707+
708708
# Store test results
709709
- store_test_results:
710710
path: test-results
@@ -747,7 +747,7 @@ jobs:
747747
command: |
748748
mv coverage.xml pass_through_unit_tests_coverage.xml
749749
mv .coverage pass_through_unit_tests_coverage
750-
750+
751751
# Store test results
752752
- store_test_results:
753753
path: test-results
@@ -789,7 +789,7 @@ jobs:
789789
command: |
790790
mv coverage.xml image_gen_coverage.xml
791791
mv .coverage image_gen_coverage
792-
792+
793793
# Store test results
794794
- store_test_results:
795795
path: test-results
@@ -835,7 +835,7 @@ jobs:
835835
command: |
836836
mv coverage.xml logging_coverage.xml
837837
mv .coverage logging_coverage
838-
838+
839839
# Store test results
840840
- store_test_results:
841841
path: test-results
@@ -875,7 +875,7 @@ jobs:
875875
pwd
876876
ls
877877
python -m pytest -vv tests/local_testing/test_basic_python_version.py
878-
878+
879879
installing_litellm_on_python_3_13:
880880
docker:
881881
- image: cimg/python:3.13.1
@@ -1039,7 +1039,7 @@ jobs:
10391039
cat docker_output.log
10401040
exit 1
10411041
fi
1042-
1042+
10431043
build_and_test:
10441044
machine:
10451045
image: ubuntu-2204:2023.10.1
@@ -1085,9 +1085,9 @@ jobs:
10851085
pip install "langfuse>=2.0.0"
10861086
pip install "logfire==0.29.0"
10871087
pip install numpydoc
1088-
pip install prisma
1089-
pip install fastapi
1090-
pip install jsonschema
1088+
pip install prisma
1089+
pip install fastapi
1090+
pip install jsonschema
10911091
pip install "httpx==0.24.1"
10921092
pip install "gunicorn==21.2.0"
10931093
pip install "anyio==3.7.1"
@@ -1203,9 +1203,9 @@ jobs:
12031203
pip install "langfuse>=2.0.0"
12041204
pip install "logfire==0.29.0"
12051205
pip install numpydoc
1206-
pip install prisma
1207-
pip install fastapi
1208-
pip install jsonschema
1206+
pip install prisma
1207+
pip install fastapi
1208+
pip install jsonschema
12091209
pip install "httpx==0.24.1"
12101210
pip install "gunicorn==21.2.0"
12111211
pip install "anyio==3.7.1"
@@ -1322,9 +1322,9 @@ jobs:
13221322
pip install "langfuse>=2.0.0"
13231323
pip install "logfire==0.29.0"
13241324
pip install numpydoc
1325-
pip install prisma
1326-
pip install fastapi
1327-
pip install jsonschema
1325+
pip install prisma
1326+
pip install fastapi
1327+
pip install jsonschema
13281328
pip install "httpx==0.24.1"
13291329
pip install "gunicorn==21.2.0"
13301330
pip install "anyio==3.7.1"
@@ -1387,8 +1387,9 @@ jobs:
13871387
pwd
13881388
ls
13891389
python -m pytest -vv tests/otel_tests -x --junitxml=test-results/junit.xml --durations=5
1390-
no_output_timeout: 120m
1391-
# Clean up first container
1390+
no_output_timeout:
1391+
120m
1392+
# Clean up first container
13921393
- run:
13931394
name: Stop and remove first container
13941395
command: |
@@ -1524,8 +1525,9 @@ jobs:
15241525
name: Run tests
15251526
command: |
15261527
python -m pytest -vv tests/basic_proxy_startup_tests -x --junitxml=test-results/junit-2.xml --durations=5
1527-
no_output_timeout: 120m
1528-
# Clean up first container
1528+
no_output_timeout:
1529+
120m
1530+
# Clean up first container
15291531
- run:
15301532
name: Stop and remove first container
15311533
command: |
@@ -1572,9 +1574,9 @@ jobs:
15721574
pip install mypy
15731575
pip install pyarrow
15741576
pip install numpydoc
1575-
pip install prisma
1576-
pip install fastapi
1577-
pip install jsonschema
1577+
pip install prisma
1578+
pip install fastapi
1579+
pip install jsonschema
15781580
pip install "httpx==0.24.1"
15791581
pip install "anyio==3.7.1"
15801582
pip install "asyncio==3.4.3"
@@ -1676,7 +1678,6 @@ jobs:
16761678
- codecov/upload:
16771679
file: ./coverage.xml
16781680

1679-
16801681
publish_to_pypi:
16811682
docker:
16821683
- image: cimg/python:3.8
@@ -1703,7 +1704,6 @@ jobs:
17031704
circleci step halt
17041705
fi
17051706
1706-
17071707
- run:
17081708
name: Checkout code
17091709
command: git checkout $CIRCLE_SHA1
@@ -1792,9 +1792,9 @@ jobs:
17921792
pip install mypy
17931793
pip install pyarrow
17941794
pip install numpydoc
1795-
pip install prisma
1796-
pip install fastapi
1797-
pip install jsonschema
1795+
pip install prisma
1796+
pip install fastapi
1797+
pip install jsonschema
17981798
pip install "httpx==0.24.1"
17991799
pip install "anyio==3.7.1"
18001800
pip install "asyncio==3.4.3"
@@ -1845,6 +1845,28 @@ jobs:
18451845
- store_test_results:
18461846
path: test-results
18471847

1848+
test_nonroot_image:
1849+
machine:
1850+
image: ubuntu-2204:2023.10.1
1851+
resource_class: xlarge
1852+
working_directory: ~/project
1853+
steps:
1854+
- checkout
1855+
- run:
1856+
name: Build Docker image
1857+
command: |
1858+
docker build -t non_root_image:latest . -f ./docker/Dockerfile.non_root
1859+
- run:
1860+
name: Install Container Structure Test
1861+
command: |
1862+
curl -LO https://github.com/GoogleContainerTools/container-structure-test/releases/download/v1.19.3/container-structure-test-linux-amd64
1863+
chmod +x container-structure-test-linux-amd64
1864+
sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
1865+
- run:
1866+
name: Run Container Structure Test
1867+
command: |
1868+
container-structure-test test --image non_root_image:latest --config docker/tests/nonroot.yaml
1869+
18481870
test_bad_database_url:
18491871
machine:
18501872
image: ubuntu-2204:2023.10.1
@@ -1910,10 +1932,10 @@ workflows:
19101932
- /litellm_.*/
19111933
- litellm_assistants_api_testing:
19121934
filters:
1913-
branches:
1914-
only:
1915-
- main
1916-
- /litellm_.*/
1935+
branches:
1936+
only:
1937+
- main
1938+
- /litellm_.*/
19171939
- litellm_router_testing:
19181940
filters:
19191941
branches:
@@ -2086,4 +2108,3 @@ workflows:
20862108
branches:
20872109
only:
20882110
- main
2089-

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ tests
99
.devcontainer
1010
*.tgz
1111
log.txt
12+
docker/Dockerfile.*

0 commit comments

Comments
 (0)