Skip to content

Commit

Permalink
Set proxy_env_vars in OpenStackRunnerManager (#363)
Browse files Browse the repository at this point in the history
* set proxy_env_vars in OpenStackRunnerManager

* lint

* disable aproxy in private endpoint runners

* disable aproxy conditionally

* enable log_cli

* temporarily disable env vars to test if integration test fails - REVERT ME

* disable aproxy unconditionally

* Revert latest commits

Revert "disable aproxy in private endpoint runners"

This reverts commit acfc35a.

Revert "disable aproxy conditionally"

This reverts commit e45878e.

Revert "enable log_cli"

This reverts commit f8207a7.

Revert "temporarily disable env vars to test if integration test fails - REVERT ME"

This reverts commit e0dca27.

Revert "disable aproxy unconditionally"

This reverts commit c47ef6e.
  • Loading branch information
cbartz authored Sep 6, 2024
1 parent 5b8c99a commit d4fdc69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src-docs/openstack_cloud.openstack_runner_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ The prefix of runner names.

---

<a href="../src/openstack_cloud/openstack_runner_manager.py#L311"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/openstack_cloud/openstack_runner_manager.py#L320"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `cleanup`

Expand All @@ -156,7 +156,7 @@ Cleanup runner and resource on the cloud.

---

<a href="../src/openstack_cloud/openstack_runner_manager.py#L161"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/openstack_cloud/openstack_runner_manager.py#L170"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `create_runner`

Expand Down Expand Up @@ -186,7 +186,7 @@ Create a self-hosted runner.

---

<a href="../src/openstack_cloud/openstack_runner_manager.py#L260"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/openstack_cloud/openstack_runner_manager.py#L269"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `delete_runner`

Expand All @@ -210,7 +210,7 @@ Delete self-hosted runners.

---

<a href="../src/openstack_cloud/openstack_runner_manager.py#L286"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/openstack_cloud/openstack_runner_manager.py#L295"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `flush_runners`

Expand All @@ -233,7 +233,7 @@ Remove idle and/or busy runners.

---

<a href="../src/openstack_cloud/openstack_runner_manager.py#L206"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/openstack_cloud/openstack_runner_manager.py#L215"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `get_runner`

Expand All @@ -256,7 +256,7 @@ Get a self-hosted runner by instance id.

---

<a href="../src/openstack_cloud/openstack_runner_manager.py#L228"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>
<a href="../src/openstack_cloud/openstack_runner_manager.py#L237"><img align="right" style="float:right;" src="https://img.shields.io/badge/-source-cccccc?style=flat-square"></a>

### <kbd>method</kbd> `get_runners`

Expand Down
11 changes: 10 additions & 1 deletion src/openstack_cloud/openstack_runner_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
from metrics import storage as metrics_storage
from openstack_cloud.openstack_cloud import OpenstackCloud, OpenstackInstance
from repo_policy_compliance_client import RepoPolicyComplianceClient
from utilities import retry
from utilities import retry, set_env_var

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -149,6 +149,15 @@ def __init__( # pylint: disable=R0913
prefix=self.name_prefix,
)

# Setting the env var to this process and any child process spawned.
proxies = service_config.proxy_config
if no_proxy := proxies.no_proxy:
set_env_var("NO_PROXY", no_proxy)
if http_proxy := proxies.http:
set_env_var("HTTP_PROXY", http_proxy)
if https_proxy := proxies.https:
set_env_var("HTTPS_PROXY", https_proxy)

@property
def name_prefix(self) -> str:
"""The prefix of runner names.
Expand Down

0 comments on commit d4fdc69

Please sign in to comment.