UltraCloud demo
Photon Tasks
TODO items live in FlareDB, attached files live in LightningStor, and the whole app stays alive across restart and migration.
Cluster Snapshot
Useful while you are bouncing the VM around the cluster.
{ modulesPath, lib, pkgs, ... }: let pythonWithBoto3 = pkgs.python3.withPackages (ps: [ ps.boto3 ps.python-multipart ]); photonVmDemoIamProto = pkgs.writeText "photon-vm-demo-iam.proto" (builtins.readFile ../../iam/proto/iam.proto); photonVmDemoApi = pkgs.writeText "photon-vm-demo-api.py" '' import html import json import mimetypes import os import socket import struct import subprocess import threading import time import traceback import urllib.parse import urllib.request import uuid from http import HTTPStatus from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer import boto3 from botocore.config import Config from botocore.exceptions import ClientError from python_multipart import create_form_parser DATA_MOUNT = "/mnt/photon-vm-data" CONFIG_PATH = os.path.join(DATA_MOUNT, "demo-config.json") ROOT_BOOT_COUNT_PATH = "/var/lib/photon-vm-smoke/boot-count" DATA_BOOT_COUNT_PATH = os.path.join(DATA_MOUNT, "boot-count") CONSOLE_PATH = "/dev/ttyS0" LISTEN_HOST = "0.0.0.0" LISTEN_PORT = 8080 GATEWAY_IP_FALLBACK = "10.62.10.1" UPLOAD_TMP_DIR = os.path.join(DATA_MOUNT, ".upload-tmp") MAX_IN_MEMORY_UPLOAD = 1024 * 1024 AWS_REGION = "us-east-1" ORG_ID = "matrix-tenant-org" PROJECT_ID = "matrix-tenant-project" FLAREDB_SHARED_NAMESPACE = "validation" STATE_OBJECT_KEY = "state.json" ATTACHMENT_PREFIX = "attachments" GRPCURL_BIN = "${pkgs.grpcurl}/bin/grpcurl" IAM_PROTO_PATH = "${photonVmDemoIamProto}" IAM_PROTO_DIR = os.path.dirname(IAM_PROTO_PATH) IAM_PROTO_FILE = os.path.basename(IAM_PROTO_PATH) UI_HTML = """
UltraCloud demo
TODO items live in FlareDB, attached files live in LightningStor, and the whole app stays alive across restart and migration.
Useful while you are bouncing the VM around the cluster.