Skip to content

Commit

Permalink
added internal gateway, and access for and backend url and use https …
Browse files Browse the repository at this point in the history
…forc backend
  • Loading branch information
dweinholz committed Nov 12, 2024
1 parent 5fb6bbe commit 0198ea4
Show file tree
Hide file tree
Showing 11 changed files with 177 additions and 141 deletions.
2 changes: 1 addition & 1 deletion portal_client.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ service VirtualMachineService {
/** Get boolean if client has backend url configured*/
bool has_forc()

string get_forc_url()
string get_forc_access_url()

/** Create a backend*/
Backend create_backend(
Expand Down
14 changes: 10 additions & 4 deletions simple_vm_client/VirtualMachineHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,12 @@ def get_playbook_logs(self, openstack_id: str) -> PlaybookResult:
def has_forc(self) -> bool:
return self.forc_connector.has_forc()

def get_forc_url(self) -> str:
def get_forc_access_url(self) -> str:
return self.forc_connector.get_forc_access_url()

def get_forc_backend_url(self) -> str:
return self.forc_connector.get_forc_backend_url()

def create_snapshot(
self,
openstack_id: str,
Expand Down Expand Up @@ -472,8 +475,7 @@ def create_and_deploy_playbook(
port = int(
self.openstack_connector.get_vm_ports(openstack_id=openstack_id)["port"]
)
gateway_ip = self.openstack_connector.get_gateway_ip()["gateway_ip"]
if self.openstack_connector.netcat(host=gateway_ip, port=port):
if self.openstack_connector.netcat(port=port):
cloud_site = self.openstack_connector.CLOUD_SITE
return self.forc_connector.create_and_deploy_playbook(
public_key=public_key,
Expand All @@ -483,7 +485,11 @@ def create_and_deploy_playbook(
apt_packages=apt_packages,
openstack_id=openstack_id,
port=port,
ip=gateway_ip,
ip=(
self.INTERNAL_GATEWAY_IP
if self.INTERNAL_GATEWAY_IP
else self.GATEWAY_IP
),
cloud_site=cloud_site,
base_url=base_url,
)
Expand Down
8 changes: 4 additions & 4 deletions simple_vm_client/VirtualMachineService-remote
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if len(sys.argv) <= 1 or sys.argv[1] == "--help":
)
print(" PlaybookResult get_playbook_logs(string openstack_id)")
print(" bool has_forc()")
print(" string get_forc_url()")
print(" string get_forc_access_url()")
print(
" Backend create_backend(string owner, string user_path, string template, string upstream_url)"
)
Expand Down Expand Up @@ -523,11 +523,11 @@ elif cmd == "has_forc":
sys.exit(1)
pp.pprint(client.has_forc())

elif cmd == "get_forc_url":
elif cmd == "get_forc_access_url":
if len(args) != 0:
print("get_forc_url requires 0 args")
print("get_forc_access_url requires 0 args")
sys.exit(1)
pp.pprint(client.get_forc_url())
pp.pprint(client.get_forc_access_url())

elif cmd == "create_backend":
if len(args) != 4:
Expand Down
51 changes: 27 additions & 24 deletions simple_vm_client/VirtualMachineService.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions simple_vm_client/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ openstack:
udp_port_calculation: 30000 + x + y * 256
# Calculation for determining the UDP port. Schema -> 192.168.y.x
gateway_ip: 129.70.51.75
# IP address of the OpenStack gateway.
# Can be provided if the external Gateway is not reachable for the Client (Berlin) OPTIONAL
internal_gateway_ip: 129.70.51.75
#IP address of the OpenStack gateway.
network: portalexternalnetwork
# Name or identifier of the openstack network

Expand All @@ -74,9 +76,10 @@ bibigrid:
forc:
activated: False
# If Forc ist activated -- defaults to True
forc_url: https://proxy-dev.bi.denbi.de:5000/
# URL for FORC backend.
forc_backend_url: https://proxy-dev.bi.denbi.de/
forc_backend_url: https://proxy-dev.bi.denbi.de:5000/
forc_backend_use_https: True
# URL for FORC.
forc_access_url: https://proxy-dev.bi.denbi.de/
# Access URL for FORC - optional - default is forc_url without port.
github_playbooks_repo: https://github.com/deNBI/resenvs/archive/refs/heads/staging.zip
# GitHub repository URL for FORC playbooks.
Expand Down
5 changes: 4 additions & 1 deletion simple_vm_client/config/config_local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ openstack:
udp_port_calculation: 30000 + x + y * 256
# Calculation for determining the UDP port. Schema -> 192.168.y.x
gateway_ip: 129.70.51.75
# Can be provided if the external Gateway is not reachable for the Client (Berlin) OPTIONAL
internal_gateway_ip: 129.70.51.75
# IP address of the OpenStack gateway.
network: portalexternalnetwork
# Name or identifier of the openstack network
Expand All @@ -74,7 +76,8 @@ bibigrid:
forc:
activated: True
# If Forc ist activated -- defaults to True
forc_url: https://proxy-dev.bi.denbi.de:5000/
forc_backend_url: https://proxy-dev.bi.denbi.de:5000/
forc_backend_use_https: True
# URL for FORC.
forc_access_url: https://proxy-dev.bi.denbi.de/
# Access URL for FORC - optional - default is forc_url without port.
Expand Down
Loading

0 comments on commit 0198ea4

Please sign in to comment.