Skip to content

API

Layout Model

Synopsis:

from ogc.deployer import init, fs

deployment = init(
    layout_model=dict(
        instance_size="e2-standard-4",
        name="ubuntu-ogc",
        provider="google",
        remote_path="/home/ubuntu/ogc",
        runs_on="ubuntu-2004-lts",
        scale=9,
        scripts="fixtures/ex_deploy_ubuntu",
        username="ubuntu",
        ssh_private_key=fs.expand_path("~/.ssh/id_rsa_libcloud"),
        ssh_public_key=fs.expand_path("~/.ssh/id_rsa_libcloud.pub"),
        ports=["22:22", "80:80", "443:443", "5601:5601"],
        tags=[],
        labels=dict(
            division="engineering", org="obs", team="observability", project="perf"
        ),
    ),
)

def rerun_scripts(**kwargs: str):
    deployment.exec_scripts(**kwargs)
Example
> ogc ubuntu.py ls -v
# Or run a custom task `rerun_scripts`
> ogc ubuntu.py rerun_scripts -v -o scripts=/a/different/scripts/path

instance_size class-attribute

instance_size = CharField()

name class-attribute

name = CharField()

provider class-attribute

provider = CharField()

remote_path class-attribute

remote_path = CharField()

runs_on class-attribute

runs_on = CharField()

scale class-attribute

scale = IntegerField()

scripts class-attribute

scripts = CharField()

username class-attribute

username = CharField()

ssh_private_key class-attribute

ssh_private_key = CharField()

ssh_public_key class-attribute

ssh_public_key = CharField()

tags class-attribute

tags = JSONField(null=True)

labels class-attribute

labels = JSONField()

ports class-attribute

ports = JSONField()

arch class-attribute

arch = CharField(null=True)

exclude class-attribute

exclude = CharField(null=True)

extra class-attribute

extra = JSONField(null=True)

include class-attribute

include = CharField(null=True)

Meta

table_name class-attribute

table_name = 'layouts'