Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
03c4340
feat(oracle): specify subnet by id for instances
uhryniuk Feb 25, 2025
f85d617
feat(oracle): provide custom metadata to launch details
uhryniuk Feb 26, 2025
751e920
test(oracle): add OCI example tests for OFED userspace tools and iperf3
trentindav Feb 27, 2025
1f6c1da
feat(cloud): add PRO_FIPS_UPDATES as an image type
renanrodrigo Apr 11, 2025
42a3311
feat(ec2): add filter string to query for FIPS Updates images
renanrodrigo Apr 11, 2025
5aea92e
feat(azure): add dict for FIPS Updates images
renanrodrigo Apr 11, 2025
d9c8c7a
feat(gce): add name filter for FIPS Updates images
renanrodrigo Apr 15, 2025
6bfeac1
chore: add FIPS Updates to the demo examples
renanrodrigo Apr 11, 2025
cf40502
tests(ec2): add integration test for Pro image filters
renanrodrigo Apr 15, 2025
cfdb296
tests(gce): add integration test for Pro image filters
renanrodrigo Apr 23, 2025
7e7f67b
version: bump version to 1!10.11.0
renanrodrigo Apr 11, 2025
cf72bcb
fix: openstack needs to use neutron for floating ip association
blackboxsw May 7, 2025
49357f7
chore: drop unsupported focal tests from github workflow for py38
blackboxsw May 8, 2025
920a5a3
fix: update ibm-vpc dependencies per breaking change in 0.28.0
blackboxsw May 8, 2025
00a20b9
chore: add questing to releases
blackboxsw May 9, 2025
ad3e7ef
fix(ibm): Fix get_instance (#488)
hammerstefan Jul 25, 2025
6131272
fix(azure): mypy linting error (#489)
hammerstefan Jul 25, 2025
77efb56
[ibm] Make IBM `_wait_for_instance_start` timeout configurable (#487)
Gisaldjo Jul 28, 2025
5cacb64
chore: bump version to 11.0.0
a-dubs Feb 24, 2025
4d01895
ci(github): make main-check run against vXX branches and version only…
a-dubs Feb 24, 2025
cf61f58
feat!: add networking type and networking config typings
a-dubs Feb 19, 2025
cef8a8c
feat(oracle): allow for specifying network configuration
a-dubs Feb 19, 2025
01ab537
feat!: add ability to retain snapshot after cleanup
a-dubs Aug 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@ jobs:
uses: actions/checkout@v4
- name: Run ruff and mypy checks
run: tox -e ruff,mypy
py38:
runs-on: ubuntu-20.04
steps:
- name: Install dependencies
run: sudo DEBIAN_FRONTEND=noninteractive apt-get -qy install tox
- name: Git checkout
uses: actions/checkout@v4
- name: Run tox
run: tox -e py38
py310:
runs-on: ubuntu-22.04
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/main_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- 'v*'

jobs:
post-merge-tests:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/version_check.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Check Semantic Versioning
on:
- pull_request
pull_request:
branches:
- main

jobs:
version-check:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1!10.9.1
1!11.0.0
26 changes: 25 additions & 1 deletion examples/az.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import logging

import pycloudlib
from pycloudlib.cloud import ImageType
from pycloudlib.types import ImageType

cloud_config = """#cloud-config
runcmd:
Expand Down Expand Up @@ -109,6 +109,29 @@ def demo_pro_fips():
print(instance.execute("sudo ua status --wait"))


def demo_pro_fips_updates():
"""Show example of launchig a Ubuntu PRO FIPS image through Azure."""
with pycloudlib.Azure(tag="azure") as client:
image_id = client.daily_image(release="jammy", image_type=ImageType.PRO_FIPS_UPDATES)

pub_key, priv_key = client.create_key_pair(key_name="test_pro_fips")
pub_path, priv_path = save_keys(
key_name="test_pro_fips",
pub_key=pub_key,
priv_key=priv_key,
)
client.use_key(pub_path, priv_path)

print("Launching Focal Pro FIPS Updates instance.")
with client.launch(
image_id=image_id,
instance_type="Standard_DS2_v2", # default is Standard_DS1_v2
) as instance:
instance.wait()
print(instance.ip)
print(instance.execute("sudo ua status --wait"))


if __name__ == "__main__":
# Avoid polluting the log with azure info
logging.getLogger("adal-python").setLevel(logging.WARNING)
Expand All @@ -118,3 +141,4 @@ def demo_pro_fips():
demo()
demo_pro()
demo_pro_fips()
demo_pro_fips_updates()
37 changes: 16 additions & 21 deletions examples/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os

import pycloudlib
from pycloudlib.cloud import ImageType
from pycloudlib.types import ImageType


def hot_add(ec2, daily):
Expand Down Expand Up @@ -92,22 +92,13 @@ def launch_basic(ec2, daily):
print(instance.availability_zone)


def launch_pro(ec2, daily):
"""Show basic functionality on PRO instances."""
print("Launching Pro instance...")
with ec2.launch(daily) as instance:
instance.wait()
print(instance.execute("sudo ua status --wait"))
print("Deleting Pro instance...")


def launch_pro_fips(ec2, daily):
"""Show basic functionality on PRO instances."""
print("Launching Pro FIPS instance...")
with ec2.launch(daily) as instance:
def launch_pro(ec2, name, image):
"""Show basic functionality on Pro instances."""
print("Launching {} instance...".format(name))
with ec2.launch(image) as instance:
instance.wait()
print(instance.execute("sudo ua status --wait"))
print("Deleting Pro FIPS instance...")
print(instance.execute("sudo pro status --wait"))
print("Deleting {} instance...".format(name))


def handle_ssh_key(ec2, key_name):
Expand Down Expand Up @@ -140,13 +131,17 @@ def demo():
key_name = "test-ec2"
handle_ssh_key(ec2, key_name)

daily = ec2.daily_image(release="bionic")
daily_pro = ec2.daily_image(release="bionic", image_type=ImageType.PRO)
daily_pro_fips = ec2.daily_image(release="bionic", image_type=ImageType.PRO_FIPS)
daily = ec2.daily_image(release="focal")
daily_pro = ec2.daily_image(release="focal", image_type=ImageType.PRO)
daily_pro_fips = ec2.daily_image(release="focal", image_type=ImageType.PRO_FIPS)
daily_pro_fips_updates = ec2.daily_image(
release="focal", image_type=ImageType.PRO_FIPS_UPDATES
)

launch_basic(ec2, daily)
launch_pro(ec2, daily_pro)
launch_pro_fips(ec2, daily_pro_fips)
launch_pro(ec2, "PRO", daily_pro)
launch_pro(ec2, "PRO FIPS", daily_pro_fips)
launch_pro(ec2, "PRO FIPS UPDATES", daily_pro_fips_updates)
custom_vpc(ec2, daily)
snapshot(ec2, daily)
launch_multiple(ec2, daily)
Expand Down
21 changes: 7 additions & 14 deletions examples/gce.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import os

import pycloudlib
from pycloudlib.cloud import ImageType
from pycloudlib.types import ImageType


def manage_ssh_key(gce):
Expand Down Expand Up @@ -39,20 +39,12 @@ def generic(gce):
print(inst.execute("lsb_release -a"))


def pro(gce):
def pro(gce, series, image_type):
"""Show example of running a GCE PRO machine."""
daily = gce.daily_image("bionic", image_type=ImageType.PRO)
daily = gce.daily_image(series, image_type)
with gce.launch(daily) as inst:
inst.wait()
print(inst.execute("sudo ua status --wait"))


def pro_fips(gce):
"""Show example of running a GCE PRO FIPS machine."""
daily = gce.daily_image("bionic", image_type=ImageType.PRO_FIPS)
with gce.launch(daily) as inst:
inst.wait()
print(inst.execute("sudo ua status --wait"))
print(inst.execute("sudo pro status --wait"))


def demo():
Expand All @@ -62,8 +54,9 @@ def demo():
manage_ssh_key(gce)

generic(gce)
pro(gce)
pro_fips(gce)
pro(gce, "focal", ImageType.PRO)
pro(gce, "focal", ImageType.PRO_FIPS)
pro(gce, "jammy", ImageType.PRO_FIPS_UPDATES)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion examples/lxd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import textwrap

import pycloudlib
from pycloudlib.cloud import ImageType
from pycloudlib.types import ImageType

RELEASE = "noble"

Expand Down
49 changes: 49 additions & 0 deletions examples/openstack_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/usr/bin/env python3
# This file is part of pycloudlib. See LICENSE file for license information.
"""Basic examples of various lifecycles with a Openstack instance."""

import logging
import os
import sys

import pycloudlib

REQUIRED_ENV_VARS = ("OS_AUTH_URL", "OS_PASSWORD", "OS_USERNAME")


def basic_lifecycle(image_id: str):
"""Demonstrate basic set of lifecycle operations with OpenStack."""
with pycloudlib.Openstack("pycloudlib-test") as os_cloud:
with os_cloud.launch(image_id=image_id) as inst:
inst.wait()

result = inst.execute("uptime")
print(result)
inst.console_log()
inst.delete(wait=False)


def demo(image_id: str):
"""Show examples of using the Openstack module."""
basic_lifecycle(image_id)


def assert_openstack_config():
"""Assert any required OpenStack env variables and args needed for demo."""
if len(sys.argv) != 2:
sys.stderr.write(
f"Usage: {sys.argv[0]} <openstack_image_id>\n"
"Must provide an image id from openstack image list\n\n"
)
sys.exit(1)
for env_name in REQUIRED_ENV_VARS:
assert os.environ.get(
env_name
), f"Missing required Openstack environment variable: {env_name}"


if __name__ == "__main__":
assert_openstack_config()
logging.basicConfig(level=logging.DEBUG)
image_id = sys.argv[1]
demo(image_id=sys.argv[1])
Loading