readme and deploy.sh
This commit is contained in:
parent
3c4e3541a3
commit
2ce18b73dc
14
README.md
Normal file
14
README.md
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
# 4 - public cloud
|
||||
- Odpal skrypt:
|
||||
``` python 4/loadbalancer-init.py ```
|
||||
- Przejdź po adres:
|
||||
```http::/[public_IP]/factors[liczba]```
|
||||
gdzie public_IP - wyświetlony w terminalu adres
|
||||
liczba - int do wpisania ręcznie
|
||||
|
||||
##
|
||||
- Odpalenie skryptu:
|
||||
- ```./deploy.sh```
|
||||
- Wywoła sprawdzenie load_balancera przy pomocy skryptu
|
||||
|
6
deploy.sh
Executable file
6
deploy.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
python loadbalancer-init.py
|
||||
sleep 60
|
||||
python script_check.py
|
||||
|
@ -128,3 +128,7 @@ print(f"Loadbalancer creating...: {loadbalancer.action.complete}")
|
||||
|
||||
load_balancer = client.load_balancers.get_by_name(f"{PREFIX}-loadbalancer")
|
||||
print(f"Webserwis: http://{load_balancer.data_model.public_net.ipv4.ip}:80/factors/")
|
||||
|
||||
with open('url.txt', 'w') as f:
|
||||
url = 'http://'+load_balancer.data_model.public_net.ipv4.ip
|
||||
f.write(url)
|
||||
|
@ -6,9 +6,9 @@ import threading
|
||||
import logging
|
||||
|
||||
logging.getLogger().setLevel(logging.INFO)
|
||||
|
||||
API_URL = "http://95.217.175.175"
|
||||
|
||||
with open('url.txt', 'r') as f:
|
||||
API_URL = f.read()
|
||||
print(API_URL)
|
||||
UNIT = 5.0 # secs
|
||||
|
||||
# Pre generated primes
|
||||
|
Loading…
Reference in New Issue
Block a user