Upgrade from 1.23.0 to 1.24.0

Changes to the Unity Asset Package

We split the Genvid Unity Asset Package into two different parts. One allows you to integrate the Genvid SDK into your game. The other adds tooling to the Unity Editor interface for interacting with your clusters.

Make sure you completely uninstall the older version of the Genvid asset package before upgrading to 1.24.0.

Changes to the Unity Cube Sample

  • We moved the Genvid_SubmitNotification() family of methods from GenvidStreams to GenvidSession as notifications are not sent on streams.

  • We made the error handling of the Submit* methods more consistent and informative.

YouTube Embedded Player and SSL Support

You can now use the YouTube Embedded Player with an SSL protected website. When doing so, you must use SSL clusters with names that terminate in ways that indicate they use SSL (such as _alb_ssl).

When using an SSL module, its leaf endpoint and a web endpoint must be loaded in the cluster configuration by using the loadEndpoint() method in /samples/cube/web/web.py.

    def loadEndpoint(self):
        leaf_endpoint = self.get_leaf_endpoint()
        web_endpoint = self.get_web_endpoint()
        config = {
            'version': '1.7.0',
            'config': {
                'cloud': {
                    'endpoint': {
                        'leaf': '',
                        'web': ''
                    }
                }
            }
        }
        config['config']['cloud']['endpoint']['leaf'] = leaf_endpoint
        config['config']['cloud']['endpoint']['web'] = web_endpoint
        return config

To stream YouTube embedded on a website with SSL, you must load the file youtube.sample.hcl located in samples/streaming_services to the cluster configuration. This file contains the new configuration that enables embedding with SSL by setting embed_ssl to true.

config {
  embed_ssl {
    enabled = false
  }
} // end of config

SSL Support on Local Cluster

It is now possible to generate self-signed SSL certificates for your local cluster when loading the web sample. A new python script /py-genvid-toolbox/genvid/toolbox/generate_ssl.py uses HashiCorp Vault to generate the certificates that the backend of the Web Sample will use.

#!/usr/bin/env python3
import hvac
import os
import json
import consul


class GenerateCertificate:

    def create_new_ssl(self):
        client = hvac.Client(url='http://127.0.0.1:8200')

        secrets_engines_list = client.sys.list_mounted_secrets_engines(
        )['data']

        if "pki/" in secrets_engines_list:
            print('The PKI engine is already enabled.')
        else:
            client.sys.enable_secrets_engine(backend_type='pki', )
            print('The PKI engine has been enabled')

        client.sys.tune_mount_configuration(
            path='pki',
            max_lease_ttl='87600h',
        )

        generate_root_response = client.secrets.pki.generate_root(
            type='exported', common_name='New root CA')
        print('New root CA: {}'.format(generate_root_response))

        set_urls_response = client.secrets.pki.set_urls({
            'issuing_certificates': ['http://127.0.0.1:8200/v1/pki/ca'],
            'crl_distribution_points': ['http://127.0.0.1:8200/v1/pki/crl']
        })

        create_or_update_role_response = client.secrets.pki.create_or_update_role(
            'localhostrole', {
                'ttl': '72h',
                'allow_localhost': 'true'
            })
        print('New role: {}'.format(create_or_update_role_response))

        generate_certificate_response = client.secrets.pki.generate_certificate(
            name='localhostrole', common_name='localhost')
        response = generate_certificate_response.json()
        print('Certificate response data: ', response)

        # the following lines will create the files needed for Nodejs to read the certificate and private key.
        cur_path = os.path.dirname(__file__)

        f = open(os.path.join(cur_path, "certificate.pem"), "w")
        f.write(response["data"]["certificate"])
        f.close()

        f = open(os.path.join(cur_path, "key.pem"), "w")
        f.write(response["data"]["private_key"])
        f.close()

When loading the web sample, use the -s option to trigger the generate_ssl.py script.

py web.py load -s

Whether you’re using the standalone mode or a streaming platform, make sure to set embed_ssl to true in your hcl file to enable embedding with SSL.

config {
  embed_ssl {
    enabled = true
  }
}

Warning

If you need to load multiple hcl configuration files containing the embed_ssl key (such as twitch.sample.hcl or youtube.sample.hcl), make sure to load them after loading the web sample. Otherwise you might overwrite the values associated with the embed_ssl key.

Terraform Modules Changes

  • We removed the variable force_az from all the AWS Terraform modules. We replaced it with the new variable azs which lets you select specific availability zones.
  • We added the variable subnet_ids to AWS Terraform modules, which is an ordered list of AWS subnet IDs. The module will use the list you provide for this variable. If you don’t provide a list, the module uses the first subnet from each availability zone in the variable azs.
  • The module azurerm_basic_cluster now uses Azure Shared Images Versions to speed cluster instantiation.

To make sure that the availability zone is preserved on an existing cluster following the upgrade:

  • Write down a value of force_az,
  • Reimport the module,
  • Open the Cluster Settings page,
  • Add the noted value of force_az to the azs setting.

genvidClient.IDataFrame.timeCode adjustment

We converted genvidClient.IDataFrame.timeCode to milliseconds to match the format of genvidClient.IDataStreamFrame.timeCode. (Version 1.23.0 introduced a mismatch in the formats.)