Skip to content
Snippets Groups Projects
Verified Commit 4d231131 authored by Daniel Göbel's avatar Daniel Göbel
Browse files

Use GitLab Dependency Proxy in CI pipeline

#62
parent 7b5543c7
No related branches found
No related tags found
2 merge requests!69Delete dev branch,!59Resolve "Endpoint for developer statistics"
Pipeline #39563 passed
image: python:3.11-slim
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/python:3.11-slim
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
......@@ -43,7 +43,7 @@ integration-test-job: # Runs integration tests with the database
DB_DATABASE: "integration-test-db"
DB_HOST: "integration-test-db"
services:
- name: mysql:8
- name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/mysql:8
alias: integration-test-db
variables:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
......@@ -71,7 +71,7 @@ e2e-test-job: # Runs e2e tests on the API endpoints
DB_DATABASE: "e2e-test-db"
DB_HOST: "e2e-test-db"
services:
- name: mysql:8
- name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/mysql:8
alias: e2e-test-db
variables:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
......@@ -136,7 +136,7 @@ lint-test-job: # Runs linters checks on code
publish-dev-docker-container-job:
stage: deploy
image:
name: gcr.io/kaniko-project/executor:v1.16.0-debug
name: gcr.io/kaniko-project/executor:v1.17.0-debug
entrypoint: [""]
dependencies: []
only:
......@@ -159,7 +159,7 @@ publish-dev-docker-container-job:
publish-docker-container-job:
stage: deploy
image:
name: gcr.io/kaniko-project/executor:v1.16.0-debug
name: gcr.io/kaniko-project/executor:v1.17.0-debug
entrypoint: [""]
dependencies: []
only:
......
......@@ -145,12 +145,13 @@ class GitRepository(ABC):
Flags if the files exist.
"""
with tracer.start_as_current_span("git_check_files_exists") as span:
span.set_attribute("repository", self.url)
span.set_attributes({"repository": self.url, "files": files})
tasks = [asyncio.ensure_future(self.check_file_exists(file, client=client)) for file in files]
result = await asyncio.gather(*tasks)
if raise_error:
missing_files = [f for f, exist in zip(files, result) if not exist]
if len(missing_files) > 0:
span.set_attribute("missing_files", missing_files)
raise HTTPException(
status_code=status.HTTP_400_BAD_REQUEST,
detail=f"The files {', '.join(missing_files)} are missing in the repo {str(self)}",
......@@ -175,7 +176,8 @@ class GitRepository(ABC):
with SpooledTemporaryFile(max_size=512000) as f: # temporary file with 500kB data spooled in memory
await self.download_file(filepath, client=client, file_handle=f)
f.seek(0)
obj.upload_fileobj(f)
with tracer.start_as_current_span("s3_upload_file"):
obj.upload_fileobj(f)
async def download_file_stream(self, filepath: str, client: AsyncClient) -> AsyncIterator[bytes]:
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment