Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloud-computing-msc-ai-examples
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Rieger
cloud-computing-msc-ai-examples
Commits
56267376
Commit
56267376
authored
Apr 16, 2018
by
Sebastian Rieger
Browse files
Options
Downloads
Patches
Plain Diff
comments, changed to use default domain, var for project net
parent
46ba30bc
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
demo2-instance-with-init-script.py
+13
-15
13 additions, 15 deletions
demo2-instance-with-init-script.py
demo3-microservice.py
+12
-16
12 additions, 16 deletions
demo3-microservice.py
demo4-scale-out.py
+12
-13
12 additions, 13 deletions
demo4-scale-out.py
with
37 additions
and
44 deletions
demo2-instance-with-init-script.py
+
13
−
15
View file @
56267376
import
getpass
import
getpass
import
libcloud.security
import
os
import
os
from
libcloud.compute.providers
import
get_driver
from
libcloud.compute.providers
import
get_driver
from
libcloud.compute.types
import
Provider
from
libcloud.compute.types
import
Provider
auth_url
=
'
https://192.168.72.40:5000
'
# Please use 1-25 for X in username, project etc., as coordinated in the lab sessions
# web service endpoint of the private cloud infrastructure
auth_url
=
'
https://private-cloud2.informatik.hs-fulda.de:5000
'
# your username in OpenStack
auth_username
=
'
CloudCompX
'
# your project in OpenStack
project_name
=
'
CloudCompGrpX
'
# default region
region_name
=
'
RegionOne
'
region_name
=
'
RegionOne
'
domain_name
=
"
hsfulda
"
# domain to use, "default" for local accounts, "hsfulda" for LDAP of DVZ, e.g., using fdaiXXXX as auth_username
domain_name
=
"
default
"
ubuntu_image_name
=
"
Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image
"
ubuntu_image_name
=
"
Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image
"
...
@@ -26,20 +35,11 @@ def main():
...
@@ -26,20 +35,11 @@ def main():
#
#
###########################################################################
###########################################################################
if
"
OS_PROJECT_NAME
"
in
os
.
environ
:
project_name
=
os
.
environ
[
"
OS_PROJECT_NAME
"
]
else
:
project_name
=
input
(
"
Enter your OpenStack project:
"
)
if
"
OS_USERNAME
"
in
os
.
environ
:
auth_username
=
os
.
environ
[
"
OS_USERNAME
"
]
else
:
auth_username
=
input
(
"
Enter your OpenStack username:
"
)
if
"
OS_PASSWORD
"
in
os
.
environ
:
if
"
OS_PASSWORD
"
in
os
.
environ
:
auth_password
=
os
.
environ
[
"
OS_PASSWORD
"
]
auth_password
=
os
.
environ
[
"
OS_PASSWORD
"
]
else
:
else
:
auth_password
=
getpass
.
getpass
(
"
Enter your OpenStack password:
"
)
auth_password
=
getpass
.
getpass
(
"
Enter your OpenStack password:
"
)
# auth_password = "demo"
###########################################################################
###########################################################################
#
#
...
@@ -47,8 +47,6 @@ def main():
...
@@ -47,8 +47,6 @@ def main():
#
#
###########################################################################
###########################################################################
libcloud
.
security
.
VERIFY_SSL_CERT
=
False
provider
=
get_driver
(
Provider
.
OPENSTACK
)
provider
=
get_driver
(
Provider
.
OPENSTACK
)
conn
=
provider
(
auth_username
,
conn
=
provider
(
auth_username
,
auth_password
,
auth_password
,
...
...
This diff is collapsed.
Click to expand it.
demo3-microservice.py
+
12
−
16
View file @
56267376
import
getpass
import
getpass
import
os
import
os
import
libcloud.security
from
libcloud.compute.providers
import
get_driver
from
libcloud.compute.providers
import
get_driver
from
libcloud.compute.types
import
Provider
from
libcloud.compute.types
import
Provider
...
@@ -9,10 +8,19 @@ from libcloud.compute.types import Provider
...
@@ -9,10 +8,19 @@ from libcloud.compute.types import Provider
# services: nova, glance, neutron
# services: nova, glance, neutron
# resources: 2 instances, 2 floating ips (1 keypair, 2 security groups)
# resources: 2 instances, 2 floating ips (1 keypair, 2 security groups)
# HS-Fulda Private Cloud
# Please use 1-25 for X in username, project etc., as coordinated in the lab sessions
auth_url
=
'
https://192.168.72.40:5000
'
# web service endpoint of the private cloud infrastructure
auth_url
=
'
https://private-cloud2.informatik.hs-fulda.de:5000
'
# your username in OpenStack
auth_username
=
'
CloudCompX
'
# your project in OpenStack
project_name
=
'
CloudCompGrpX
'
# default region
region_name
=
'
RegionOne
'
region_name
=
'
RegionOne
'
domain_name
=
"
hsfulda
"
# domain to use, "default" for local accounts, "hsfulda" for LDAP of DVZ, e.g., using fdaiXXXX as auth_username
domain_name
=
"
default
"
ubuntu_image_name
=
"
Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image
"
ubuntu_image_name
=
"
Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image
"
...
@@ -31,16 +39,6 @@ def main():
...
@@ -31,16 +39,6 @@ def main():
#
#
###########################################################################
###########################################################################
if
"
OS_PROJECT_NAME
"
in
os
.
environ
:
project_name
=
os
.
environ
[
"
OS_PROJECT_NAME
"
]
else
:
project_name
=
input
(
"
Enter your OpenStack project:
"
)
if
"
OS_USERNAME
"
in
os
.
environ
:
auth_username
=
os
.
environ
[
"
OS_USERNAME
"
]
else
:
auth_username
=
input
(
"
Enter your OpenStack username:
"
)
if
"
OS_PASSWORD
"
in
os
.
environ
:
if
"
OS_PASSWORD
"
in
os
.
environ
:
auth_password
=
os
.
environ
[
"
OS_PASSWORD
"
]
auth_password
=
os
.
environ
[
"
OS_PASSWORD
"
]
else
:
else
:
...
@@ -52,8 +50,6 @@ def main():
...
@@ -52,8 +50,6 @@ def main():
#
#
###########################################################################
###########################################################################
libcloud
.
security
.
VERIFY_SSL_CERT
=
False
provider
=
get_driver
(
Provider
.
OPENSTACK
)
provider
=
get_driver
(
Provider
.
OPENSTACK
)
conn
=
provider
(
auth_username
,
conn
=
provider
(
auth_username
,
auth_password
,
auth_password
,
...
...
This diff is collapsed.
Click to expand it.
demo4-scale-out.py
+
12
−
13
View file @
56267376
...
@@ -10,10 +10,19 @@ from libcloud.compute.types import Provider
...
@@ -10,10 +10,19 @@ from libcloud.compute.types import Provider
# services: nova, glance, neutron
# services: nova, glance, neutron
# resources: 2 instances (m1.small), 2 floating ips (1 keypair, 2 security groups)
# resources: 2 instances (m1.small), 2 floating ips (1 keypair, 2 security groups)
# HS-Fulda Private Cloud
# Please use 1-25 for X in username, project etc., as coordinated in the lab sessions
auth_url
=
'
https://192.168.72.40:5000
'
# web service endpoint of the private cloud infrastructure
auth_url
=
'
https://private-cloud2.informatik.hs-fulda.de:5000
'
# your username in OpenStack
auth_username
=
'
CloudCompX
'
# your project in OpenStack
project_name
=
'
CloudCompGrpX
'
# default region
region_name
=
'
RegionOne
'
region_name
=
'
RegionOne
'
domain_name
=
"
hsfulda
"
# domain to use, "default" for local accounts, "hsfulda" for LDAP of DVZ, e.g., using fdaiXXXX as auth_username
domain_name
=
"
default
"
ubuntu_image_name
=
"
Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image
"
ubuntu_image_name
=
"
Ubuntu 14.04 - Trusty Tahr - 64-bit - Cloud Based Image
"
...
@@ -32,16 +41,6 @@ def main():
...
@@ -32,16 +41,6 @@ def main():
#
#
###########################################################################
###########################################################################
if
"
OS_PROJECT_NAME
"
in
os
.
environ
:
project_name
=
os
.
environ
[
"
OS_PROJECT_NAME
"
]
else
:
project_name
=
input
(
"
Enter your OpenStack project:
"
)
if
"
OS_USERNAME
"
in
os
.
environ
:
auth_username
=
os
.
environ
[
"
OS_USERNAME
"
]
else
:
auth_username
=
input
(
"
Enter your OpenStack username:
"
)
if
"
OS_PASSWORD
"
in
os
.
environ
:
if
"
OS_PASSWORD
"
in
os
.
environ
:
auth_password
=
os
.
environ
[
"
OS_PASSWORD
"
]
auth_password
=
os
.
environ
[
"
OS_PASSWORD
"
]
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment