Skip to content

Latest commit

 

History

History
217 lines (183 loc) · 5.37 KB

debian-gce.md

File metadata and controls

217 lines (183 loc) · 5.37 KB

Marlowe Runtime on Debian Linux

These notes document setting up and deploying Marlowe Runtime on a cloud instance of Debian Linux.

Machine configuration for Google Compute Engine (GCE)

{
  "canIpForward": false,
  "confidentialInstanceConfig": {
    "enableConfidentialCompute": false
  },
  "cpuPlatform": "Intel Broadwell",
  "creationTimestamp": "2023-06-22T13:53:49.305-07:00",
  "deletionProtection": false,
  "description": "",
  "disks": [
    {
      "architecture": "X86_64",
      "guestOsFeatures": [
        {
          "type": "UEFI_COMPATIBLE"
        },
        {
          "type": "VIRTIO_SCSI_MULTIQUEUE"
        },
        {
          "type": "GVNIC"
        },
        {
          "type": "SEV_CAPABLE"
        }
      ],
      "type": "PERSISTENT",
      "licenses": [
        "projects/debian-cloud/global/licenses/debian-11-bullseye"
      ],
      "deviceName": "mrt-mainnet-4",
      "autoDelete": true,
      "source": "projects/xxx/zones/us-central1-b/disks/mrt-mainnet-4",
      "index": 0,
      "boot": true,
      "kind": "compute#attachedDisk",
      "mode": "READ_WRITE",
      "interface": "SCSI",
      "diskSizeGb": "512"
    }
  ],
  "displayDevice": {
    "enableDisplay": false
  },
  "fingerprint": "F4BszwuJEaw=",
  "id": "7287444135789267509",
  "keyRevocationActionType": "NONE",
  "kind": "compute#instance",
  "labelFingerprint": "42WmSpB8rSM=",
  "lastStartTimestamp": "2023-06-22T13:53:56.543-07:00",
  "machineType": "projects/xxx/zones/us-central1-b/machineTypes/e2-custom-6-20480",
  "metadata": {
    "fingerprint": "FQY2mfGVriQ=",
    "kind": "compute#metadata"
  },
  "name": "mrt-mainnet-4",
  "networkInterfaces": [
    {
      "stackType": "IPV4_ONLY",
      "name": "nic0",
      "network": "projects/xxx/global/networks/default",
      "accessConfigs": [
        {
          "name": "External NAT",
          "type": "ONE_TO_ONE_NAT",
          "natIP": "34.172.100.68",
          "kind": "compute#accessConfig",
          "networkTier": "PREMIUM"
        }
      ],
      "subnetwork": "projects/xxx/regions/us-central1/subnetworks/default-6827991f11af9532",
      "networkIP": "10.128.0.21",
      "fingerprint": "M2M_nWou6cU=",
      "kind": "compute#networkInterface"
    }
  ],
  "reservationAffinity": {
    "consumeReservationType": "ANY_RESERVATION"
  },
  "resourceStatus": {},
  "scheduling": {
    "onHostMaintenance": "MIGRATE",
    "provisioningModel": "STANDARD",
    "automaticRestart": true,
    "preemptible": false
  },
  "selfLink": "projects/xxx/zones/us-central1-b/instances/mrt-mainnet-4",
  "serviceAccounts": [
    {
      "email": "xxx@developer.gserviceaccount.com",
      "scopes": [
        "https://www.googleapis.com/auth/devstorage.read_only",
        "https://www.googleapis.com/auth/logging.write",
        "https://www.googleapis.com/auth/monitoring.write",
        "https://www.googleapis.com/auth/servicecontrol",
        "https://www.googleapis.com/auth/service.management.readonly",
        "https://www.googleapis.com/auth/trace.append"
      ]
    }
  ],
  "shieldedInstanceConfig": {
    "enableSecureBoot": false,
    "enableVtpm": true,
    "enableIntegrityMonitoring": true
  },
  "shieldedInstanceIntegrityPolicy": {
    "updateAutoLearnPolicy": true
  },
  "shieldedVmConfig": {
    "enableSecureBoot": false,
    "enableVtpm": true,
    "enableIntegrityMonitoring": true
  },
  "shieldedVmIntegrityPolicy": {
    "updateAutoLearnPolicy": true
  },
  "startRestricted": false,
  "status": "RUNNING",
  "tags": {
    "items": [
      "http-server"
    ],
    "fingerprint": "FYLDgkTKlA4="
  },
  "zone": "projects/xxx/zones/us-central1-b"
}

Software installation for Debian Linux

# Install required software.
sudo apt-get update
sudo apt-get install -y git uidmap docker docker-compose dbus-user-session fuse-overlayfs slirp4netns

# Enable rootless use of docker.
curl -fsSL https://get.docker.com/rootless | sh

# Reboot.
sudo shutdown -r now

Deploy Marlowe Runtime

# Set environment variables required by docker.
export PATH=$HOME/bin:$PATH
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock

# Clone the Marlowe starter kit.
git clone https://github.com/input-output-hk/marlowe-starter-kit -b runtime@v0.0.2
cd marlowe-starter-kit

# Select the network.
export NETWORK=mainnet

# Start Marlowe Runtime.
docker-compose up -d

# Check to see that services have come up successfully.
docker-compose ps

# View the logs.
docker-compose logs --timestamp --tail 200 --follow

Create a Nix environment

Install NixOs.

sh <(curl -L https://nixos.org/nix/install) --daemon

Add your account as a trusted user.

sudo sh -c "echo trusted-users = $USER >> /etc/nix/nix.conf"

Restart the Nix daemon.

sudo systemctl restart nix-daemon.service

Close the current shell/terminal session and enter a new one.

Enter a development environment

The Marlowe Runtime development environment has tools such as marlowe-runtime-cli and cardano-cli installed.

nix develop --extra-experimental-features nix-command --extra-experimental-features flakes

Launch a Jupyter notebook server

The Jupyter notebook kernel for Marlowe contains tools such as marlowe-runtime-cli and can be used to run the starter kit lessons.

nix run --extra-experimental-features nix-command --extra-experimental-features flakes

Use a web browser to visit the URL for the Jupyter notebook server.