Previously, you configured your VM through a combination of the custom-config-data.yaml
file
and a configuration hook that applied the configuration contained in this YAML file to Rhino.
While this approach was user-friendly for the operator deploying the VM,
it required development effort to design the configuration in the YAML file and implement the configuration hook for every configuration field.
This section describes an alternative approach for configuring your VM using Rhino declarative configuration.
Prerequisites
This section assumes you are familiar with the basic concepts described in the Rhino documentation around Rhino declarative configuration. If you aren’t familiar with the concepts, read that documentation first.
Steps
The declarative configuration bundle supplied to the VM must be a complete configuration bundle.
As such, it is easiest to first deploy a VM without any configuration changes to obtain
a "default" complete configuration bundle. Connect to your VM over SSH and then run the following command: Disconnect and then use You should now have a
Obtain the baseline Rhino declarative configuration
rhino-console exportdeclarativeconfig rhino-declarative-config
scp
to download this directory to your development environment:scp -r rhino@<VM management IP address>:/home/rhino/rhino-declarative-config rhino-declarative-config
rhino-declarative-config
directory containing two files: config-bundle.yaml
and namespace-default.yaml
.
You will use Rhino declarative configuration to configure the HTTP server to compress the response.
Open the Change this into:
Update the configuration
namespace-default.yaml
file in your preferred editor and then locate this fragment:- name: AutomaticContentCompression
value: false
present: true
- name: AutomaticContentCompression
value: true
present: true
Now transfer the Rhino declarative configuration files to the SIMPL VM, and from there upload it to CDS. Copy the entire Next, on the SIMPL VM, run the following commands: This will upload the configuration files to CDS.
Wait for about one minute for the configuration changes to take effect.
Upload the Rhino declarative configuration
rhino-declarative-config
directory into the /home/admin/yamls
directory on the SIMPL VM:scp -r rhino-declarative-config admin@<SIMPL VM IP address>:/home/admin/yamls
cdcsars
http-example/0.1.0/resources/rvtconfig upload-config -c <CDS address> -i /home/admin/yamls -t custom --vm-version-source this-rvtconfig
.
Run the following The output should contain and a response that isn’t human-readable.
Test the changes
curl
command:curl -v http://<VM signaling IP address>:8000/ -H "Accept-Encoding: gzip"
Content-Encoding: gzip
Result
You updated your application to support compression using declarative configuration and verified that this worked correctly.