Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lock In Python 3.12.2 #44

Merged
merged 6 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build_api:
runs-on: ubuntu-latest
container:
image: python:3.9
image: python:3.12.2
options: --user root
steps:
- name: Checkout ${{ github.event.repository.name }}
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
sonar.projectKey=usdot-jpo-ode_jpo-cvmanager
sonar.projectName=jpo-cvmanager
sonar.python.coverage.reportPaths=$GITHUB_WORKSPACE/services/cov.xml
sonar.python.version=3.12
sonar.python.version=3.12.2
api.sonar.projectBaseDir=$GITHUB_WORKSPACE/services
api.sonar.sources=addons/images/bsm_query,addons/images/count_metric,addons/images/firmware_manager,addons/images/iss_health_check,addons/images/rsu_status_check,api/src,common/pgquery.py
api.sonar.tests=addons/tests,api/tests,common/tests
Expand Down
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The JPO Connected Vehicle Manager is a web-based application that helps an organ

<b>GUI:</b> ReactJS with Redux Toolkit and Mapbox GL

<b>API:</b> Python
<b>API:</b> Python 3.12.2

<b>Features:</b>

Expand Down Expand Up @@ -88,8 +88,32 @@ The following steps are intended to help get a new user up and running the JPO C

### Debugging

Note that it is recommended to work with the Python API from a [virtual environment](https://docs.python.org/3/library/venv.html). See [Visual Studio Code](https://code.visualstudio.com/docs/python/environments) documentation for more information on how to set up a virtual environment in VS Code.
Note that it is recommended to work with the Python API from a [virtual environment](https://docs.python.org/3/library/venv.html).

#### Setting up a virtual environment from the command line
1. Verify that you have Python 3.12.2 installed on your machine by running `python3 --version`. If not, download and install it from the [Python website](https://www.python.org/downloads/).
2. Open a terminal and navigate to the root of the project.
3. Run the following command to create a virtual environment in the project root:

```bash
python3 -m venv .venv
mwodahl marked this conversation as resolved.
Show resolved Hide resolved
```
4. Activate the virtual environment:
```bash
source .venv/bin/activate
```
```cmd
.venv\Scripts\activate
```
5. Install the required packages:
```bash
pip install -r services/requirements.txt
```

#### Setting up a virtual environment with VSCode
See [Visual Studio Code](https://code.visualstudio.com/docs/python/environments) documentation for information on how to set up a virtual environment with VS Code.

#### Debugging Profile
A debugging profile has been set up for use with VSCode to allow ease of debugging with this application. To use this profile, simply open the project in VSCode and select the "Debug" tab on the left side of the screen. Then, select the "Debug Solution" profile and click the green play button. This will spin up a postgresql instance as well as the keycloak auth solution within docker containers. Once running, this will also start the debugger and attach it to the running API container. You can then set breakpoints and step through the code as needed.

For the "Debug Solution" to run properly on Windows 10/11 using WSL, the following must be configured:
Expand Down
2 changes: 1 addition & 1 deletion services/Dockerfile.api
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.0-slim
FROM python:3.12.2-slim

# Prepare the SNMP functionality for the image
RUN apt-get update
Expand Down
2 changes: 1 addition & 1 deletion services/Dockerfile.bsm_query
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.0-alpine3.18
FROM python:3.12.2-alpine3.18

WORKDIR /home

Expand Down
2 changes: 1 addition & 1 deletion services/Dockerfile.count_metric
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-slim
FROM python:3.12.2-slim

WORKDIR /home

Expand Down
2 changes: 1 addition & 1 deletion services/Dockerfile.firmware_manager
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-slim
FROM python:3.12.2-slim

WORKDIR /home

Expand Down
2 changes: 1 addition & 1 deletion services/Dockerfile.iss_health_check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.0-alpine3.18
FROM python:3.12.2-alpine3.18

WORKDIR /home

Expand Down
2 changes: 1 addition & 1 deletion services/Dockerfile.rsu_status_check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.0-alpine3.18
FROM python:3.12.2-alpine3.18

# Prepare the SNMP functionality for the image
RUN apk update
Expand Down
3 changes: 3 additions & 0 deletions services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

The CV Manager has multiple backend services that are required to allow the CV Manager to operate at full capacity.

## Python Version
These services are implemented using Python 3.12.2. It is recommended to use this version when developing, testing, and deploying the services.

## CV Manager API

The CV Manager API is the backend service for the CV Manager webapp. This API is required to be run in an accessible location for the web application to function. The API is a Python Flask REST service.
Expand Down
2 changes: 1 addition & 1 deletion services/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ gunicorn==21.2.0
pytz==2023.3.post1
Werkzeug==3.0.0
uuid==1.30
multidict==6.0.4
multidict==6.0.5
python-keycloak==2.16.2
fabric==3.2.2
paramiko==3.3.1
Expand Down
Loading