readme and deploy.sh

This commit is contained in:
Adrian Charkiewicz 2023-01-25 22:16:58 +01:00
parent 3c4e3541a3
commit 2ce18b73dc
5 changed files with 28 additions and 3 deletions

14
README.md Normal file
View 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
View File

@ -0,0 +1,6 @@
#!/bin/bash
python loadbalancer-init.py
sleep 60
python script_check.py

View File

@ -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)

View File

@ -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

1
url.txt Normal file
View File

@ -0,0 +1 @@
http://95.217.169.119