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

openstack: Implement backend and test suite #685

Merged
merged 2 commits into from
Oct 4, 2024

Conversation

cej-harris
Copy link
Contributor

Implements a backend enabling the use of an OpenStack environment to be used by runner-manager.

  • Configured using either environment variables or clouds.yaml (as implemented by openstacksdk)
  • The test suite can be run either against a real OpenStack environment (by setting the USE_LIVE_OPENSTACK environment variable to "true" and configuring the parameters required by openstacksdk)
    • If a real OpenStack environment is not available a number of mock classes are implemented to simulate an OpenStack environment
    • test_mock_signatures ensures that the mock interfaces matches the interfaces provided by openstacksdk

I've tested this against an OpenStack environment available to me and the runners spawned function and register correctly in Github.

@cej-harris cej-harris requested a review from a team as a code owner October 4, 2024 15:16
@codecov-commenter
Copy link

codecov-commenter commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 80.51948% with 15 lines in your changes missing coverage. Please review.

Project coverage is 86.68%. Comparing base (bdf1fcf) to head (e036670).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
runner_manager/backend/openstack.py 75.00% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #685      +/-   ##
==========================================
- Coverage   86.74%   86.68%   -0.06%     
==========================================
  Files          34       35       +1     
  Lines        1433     1510      +77     
==========================================
+ Hits         1243     1309      +66     
- Misses        190      201      +11     
Flag Coverage Δ
api 63.90% <45.45%> (-1.00%) ⬇️
unit 68.41% <80.51%> (+0.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cej-harris
Copy link
Contributor Author

I think the Docker build fails because netifaces requires the python3-dev package to be installed. In testing I think I got around this by changing the base image from python3.11-slim to python3.11 and forgot to include it as part of this PR. Alternatively it should be possible to install the python3-dev package on top of the slim image, but this negates some of the benefits from using the slim image.

If there's still a need for a small image size, I believe it should be possible to use a multi-stage build to install netifaces in the full Python base image and copy the Python environment and other required files into the slim Python base image.

Let me know which option you prefer and I'll have a go at implementing and testing it.

@tcarmet
Copy link
Contributor

tcarmet commented Oct 4, 2024

First of all, thank you so much for this pr @cej-harris, we were also planning to develop an openstack backend at some point, so this is a very welcome contribution!

And in regards to the Dockerfile let's stop using the slim go for python:3.11 seems like healthiest approach to solve the issue.

@tcarmet tcarmet merged commit e9a7d28 into scality:main Oct 4, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants