Skip to content

Commit dd7c20a

Browse files
committed
merged staging
2 parents 1842337 + 5b15eef commit dd7c20a

36 files changed

+10771
-10042
lines changed

.coveragerc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[run]
2+
omit =
3+
simple_vm_client/VirtualMachineService.py
4+
simple_vm_client/constants.py
5+
simple_vm_client/test_openstack_connector.py
6+
simple_vm_client/ttypes.py
7+
simple_vm_client/forc_connector/template/test_templates.py
8+
simple_vm_client/util/logger.py
9+
simple_vm_client/forc_connector/test_forc_connector.py
10+
simple_vm_client/VirtualMachineServer.py
11+
12+
check_env.py
13+
14+
[report]
15+
exclude_lines =
16+
pragma: no cover
17+
raise NotImplementedError
18+
if __name__ == .__main__.:

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v2
42+
uses: github/codeql-action/init@v3
4343
with:
4444
languages: ${{ matrix.language }}
4545
queries: +security-extended, security-and-quality
@@ -51,7 +51,7 @@ jobs:
5151
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5252
# If this step fails, then you should remove it and run the build manually (see below)
5353
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v2
54+
uses: github/codeql-action/autobuild@v3
5555

5656
# ℹ️ Command-line programs to run using the OS shell.
5757
# 📚 https://git.io/JvXDl
@@ -65,4 +65,4 @@ jobs:
6565
# make release
6666

6767
- name: Perform CodeQL Analysis
68-
uses: github/codeql-action/analyze@v2
68+
uses: github/codeql-action/analyze@v3

.github/workflows/coverage.yml

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
1-
name: 'coverage'
1+
2+
# This workflow will install dependencies, create coverage tests and run Pytest Coverage Comment
3+
# For more information see: https://github.com/MishaKav/pytest-coverage-comment/
4+
name: pytest-coverage-comment
25
on:
3-
pull_request:
4-
workflow_dispatch:
6+
pull_request:
7+
branches:
8+
- '*'
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
514

15+
- name: Set up Python 3.11
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: 3.11
619

7-
jobs:
8-
coverage:
9-
runs-on: ubuntu-latest
10-
steps:
11-
- uses: actions/[email protected]
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install flake8 pytest pytest-cov
24+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25+
26+
- name: Build coverage file
27+
run: |
28+
pytest --junitxml=pytest.xml | tee pytest-coverage.txt
1229
13-
- name: Run Coverage
14-
run: cd simplevm-client/simple_vm_client && coverage xml coverage.xml
30+
- name: Pytest coverage comment
31+
uses: MishaKav/pytest-coverage-comment@main
32+
with:
33+
pytest-coverage-path: ./pytest-coverage.txt
34+
junitxml-path: ./pytest.xml
1535

16-
- name: Get Cover
17-
uses: orgoro/[email protected]
18-
with:
19-
coverageFile: coverage.xml
20-
token: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,19 @@ repos:
99
- id: end-of-file-fixer
1010
- id: check-yaml
1111

12-
- repo: https://github.com/psf/black
13-
rev: 23.11.0
12+
- repo: https://github.com/psf/black-pre-commit-mirror
13+
14+
rev: 23.12.0
1415
hooks:
1516
- id: black
17+
language_version: python3.11
1618
- repo: https://github.com/sondrelg/pep585-upgrade
1719
rev: 'v1.0.1' # Use the sha / tag you want to point at
1820
hooks:
1921
- id: upgrade-type-hints
2022

2123
- repo: https://github.com/PyCQA/isort
22-
rev: 5.12.0
24+
rev: 5.13.2
2325
hooks:
2426
- id: isort
2527

@@ -33,7 +35,7 @@ repos:
3335
- --remove-all-unused-imports
3436

3537
- repo: https://github.com/PyCQA/flake8
36-
rev: 6.1.0
38+
rev: 7.0.0
3739
hooks:
3840
- id: flake8
3941
args: [ "--config=setup.cfg" ]

Dockerfile

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
FROM python:3.11.4-buster
2-
RUN apt-get update -y
3-
RUN apt-get install -y build-essential
2+
3+
RUN apt-get update -y \
4+
&& apt-get install -y build-essential \
5+
&& apt-get clean \
6+
&& rm -rf /var/lib/apt/lists/*
7+
48
WORKDIR /code
5-
ADD requirements.txt /code
9+
10+
# Copy requirements and install them first to leverage Docker cache
11+
COPY requirements.txt /code
612
RUN pip install -r requirements.txt
7-
ADD requirements.yml /code
8-
ADD ansible.cfg /etc/ansible/
13+
14+
COPY requirements.yml /code
15+
COPY ansible.cfg /etc/ansible/
916
RUN ansible-galaxy install -r requirements.yml
10-
ADD . /code
17+
18+
# Copy the entire project
19+
COPY . /code
20+
21+
# Set PYTHONPATH to include the project root
22+
ENV PYTHONPATH /code
23+
1124
WORKDIR /code/simple_vm_client

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ thrift_py: ## Builds python code from thrift file
1818
thrift --gen py portal_client.thrift
1919
cp -a gen-py/VirtualMachineService/. simple_vm_client
2020
rm -rf gen-py
21-
@echo Remember to fix the imports: for pip relative imports are needed, for others absolute imports
2221

2322
dev-build: ## Build and Start the docker-compose.dev.yml
2423
docker-compose -f docker-compose.dev.yml up --build

docker-compose.bibigrid.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ services:
4141

4242
# filebeat
4343
simplevm_filebeat:
44-
image: docker.elastic.co/beats/filebeat:8.11.2
44+
image: docker.elastic.co/beats/filebeat:8.11.3
4545
env_file:
4646
- .env
4747
volumes:

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ services:
2727
# filebeat
2828
simplevm_client_filebeat:
2929
container_name: simplevm_client_filebeat
30-
image: docker.elastic.co/beats/filebeat:8.11.2
30+
image: docker.elastic.co/beats/filebeat:8.11.3
3131
env_file:
3232
- .env
3333
volumes:

pytest.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# pytest.ini
2+
3+
[pytest]
4+
addopts = --cov=. --cov-config=.coveragerc
5+
6+
# Add other configuration options as needed

requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
setuptools==69.0.2
1+
setuptools==69.0.3
22
thrift==0.16.0
33
python-keystoneclient==5.2.0
4-
openstacksdk==1.5.0
4+
openstacksdk==2.0.0
55
deprecated==1.2.14
66
Click==8.1.7
77
ansible==5.1.0
8-
flake8==6.1.0
9-
paramiko==2.12.0
8+
flake8==7.0.0
9+
paramiko==3.4.0
1010
ruamel.yaml==0.18.5
1111
pyvim==3.0.3
1212
redis==5.0.1
1313
requests==2.31.0
1414
pyyaml==6.0.1
15-
pre-commit==3.5.0
15+
pre-commit==3.6.0
1616
types-PyYAML==6.0.12.12
1717
sympy==1.12
18-
types-redis==4.6.0.11
18+
types-redis==4.6.0.20240106

0 commit comments

Comments
 (0)