Skip to content

Commit

Permalink
chore: test python with connexion
Browse files Browse the repository at this point in the history
  • Loading branch information
brunopacheco1 committed Feb 14, 2024
1 parent 2ea5095 commit dad6fe1
Show file tree
Hide file tree
Showing 16 changed files with 121 additions and 1,534 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#
# SPDX-License-Identifier: Apache-2.0

*
!target/*-runner
!target/*-runner.jar
!target/lib/*
!target/quarkus-app/*
!target/quarkus-app/*
venv
__pycache__/
12 changes: 0 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ name: Run Tests
on: push

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up GraalVM JDK 21
uses: graalvm/setup-graalvm@v1
with:
java-version: '21'
- name: Run the Maven
run: mvn --batch-mode --update-snapshots verify checkstyle:check
reuse:
runs-on: ubuntu-latest
permissions:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ nb-configuration.xml

# Local environment
.env
venv

# Plugin directory
/.quarkus/cli/plugins/

__pycache__/
37 changes: 9 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
# SPDX-FileCopyrightText: 2024 PNED G.I.E.
#
# SPDX-License-Identifier: Apache-2.0
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode.
# It uses a micro base image, tuned for Quarkus native executables.
# It reduces the size of the resulting container image.
# Check https://quarkus.io/guides/quarkus-runtime-base-image for further information about this image.
#
# Before building the container image run:
#
# mvn package -Dnative
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.native-micro -t quarkus/code-with-quarkus .
#
# Then run the container using:
#
# docker run -i --rm -p 8080:8080 quarkus/code-with-quarkus
#
###
FROM quay.io/quarkus/quarkus-micro-image:2.0
WORKDIR /work/
RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root target/*-runner /work/application
FROM python:3.10-slim-bookworm

WORKDIR /code

COPY ./requirements.txt /code/requirements.txt
COPY ./run.py /code/run.py
COPY ./openapi.yaml /code/openapi.yaml

EXPOSE 8080
USER 1001
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

ENTRYPOINT ["./application", "-Dquarkus.http.host=0.0.0.0"]
CMD ["uvicorn", "run:app", "--host", "0.0.0.0", "--port", "8080"]
79 changes: 79 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# SPDX-FileCopyrightText: 2024 PNED G.I.E.
#
# SPDX-License-Identifier: Apache-2.0

openapi: 3.0.3
info:
title: Access Request Management Service - OpenAPI 3.0
description: |-
This is the OpenAPI 3.0 specification for the Access Request Management Service.
This service is responsible for managing access requests to the Genomic Data Infrastructure (GDI).
The service provides endpoints for creating, updating, and retrieving access requests, as well as managing the datasets and members associated with each request.
The service also provides endpoints for managing baskets of access requests.
#termsOfService: http://TODO/terms/
contact:
email: [email protected]
license:
name: Apache 2.0
url: https://spdx.org/licenses/Apache-2.0.html
version: 0.0.0
externalDocs:
description: Find out more about GDI
url: https://genomicdatainfrastructure.github.io/gdi-userportal-docs/
servers:
- url: https://localhost:8080
description: Development server
tags:
- name: applications
description: All endpoints related to access request management
- name: baskets
description: All endpoints related to baskets
- name: attachments
description: All endpoints related to attachments
- name: members
description: All endpoints related to members
- name: terms
description: All endpoints related to terms
- name: datasets
description: All endpoints related to datasets
- name: forms
description: All endpoints related to forms
- name: actions
description: All endpoints related to user actions
- name: events
description: All endpoints related to events
paths:
/api/v1/applications:
get:
summary: List applications
operationId: run.list_applications_v1
tags:
- "applications"
responses:
"200":
description: Successful Response
content:
application/json:
schema:
type: array
title: collection of applications
items:
$ref: "#/components/schemas/ListedApplication"
components:
schemas:
ListedApplication:
properties:
id:
type: string
title: Application id
title:
type: string
title: Application title
currentState:
type: string
title: Application state
stateChangedAt:
type: string
format: date-time
title: Status changed at
216 changes: 0 additions & 216 deletions pom.xml

This file was deleted.

2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
connexion==3.0.5
uvicorn==0.27.1
3 changes: 3 additions & 0 deletions requirements.txt.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: Genomic Data Infrastructure

SPDX-License-Identifier: Apache-2.0
Loading

0 comments on commit dad6fe1

Please sign in to comment.