Cloud computing boasts several attractive benefits for businesses and end users.
The purpose of this post is to deploy QSpace server and QGraph client in to the cloud, steps covered
Install google cloud on the PC/Linux
Creation of virtual machine on Google cloud
Use gcloud to copy client, server and script.sh file on the virtual machine
Run client and server on virtual machine
Google Cloud SDK(gcloud)
Command-line interface for Cloud Platform products and services gcloud is a tool that provides the primary command-line interface to Google Cloud Platform. You can use this tool to perform many common platform tasks either from the command-line or in scripts and other automations. gcloud manages authentication, local configuration, developer workflow, and interactions with the Cloud Platform APIs. Google Compute Engine offers high performance virtual machines, customer-friendly pricing, fast networking, and carbon-neutral impact.
Google Cloud SDK Install
Download the Google Cloud SDK installer.
Launch the installer and follow the prompts.
After installation has completed, the installer presents several options:
Make sure that the following are selected:
Start Google Cloud SDK Shell
The installer then starts a terminal window and runs the gcloud init command.
Troubleshooting tip:If your installation is unsuccessful due to the find command not being recognized, ensure your PATH environment variable is set to include the folder containing find. Usually, this is C:\WINDOWS\system32;
Make sure that your operating system is one of the following:
Ubuntu release that has not reached end-of-life
Debian stable release from Wheezy forward
Then, perform the following steps:
Create environment variable for correct distribution
To create a project, you must have the resourcemanager.projects.create permission. When an organization is created, the entire domain has the Project Creator role, which includes that permission.
To create a new project:
Go to the Manage resources page in the GCP Console.
On the Select organization drop-down list at the top of the page, select the organization in which you want to create a project.
Click Create Project.
In the New Project window that appears, enter a project name and select a billing account as applicable.
If you want to add the project to a folder, enter the folder name in the Location box.
When you’re finished entering new project details, click Create. Both the project ID and project number are displayed on the project Dashboard Project info card:
To create a new project, using the gcloud projects create command:
gcloud projects create PROJECT_ID
Where PROJECT_ID is the ID for the project you want to create. A project ID must start with a lowercase letter, and can contain only ASCII letters, digits, and hyphens, and must be between 6 and 30 characters.
To create a project with an organization or a folder as parent, use the –organization or –folder flags. As a resource can only have one parent, only one of these flags can be used:
Use the gcloud init command to perform several common SDK setup tasks. These include authorizing the SDK tools to access Google Cloud Platform using your user account credentials and setting up the default SDK configuration.
To initialize the SDK:
Run the following at a command prompt:
Note: To prevent the command from launching a web browser, use gcloud init –console-only instead. To authorize without a web browser and non-interactively, create a service account with the appropriate scopes using the Google Cloud Platform Console and use gcloud auth activate-service-account with the corresponding JSON key file.
Accept the option to log in using your Google user account:
To continue, you must log in. Would you like to log in (Y/n)? Y
In your browser, log in to your Google user account when prompted and click Allow to grant permission to access Google Cloud Platform resources.
At the command prompt, select a Cloud Platform project from the list of those where you have Owner, Editor or Viewer permissions:
Pick cloud project touse:
Please enter your numeric choice:
If you only have one project, gcloud init selects it for you.
If you have the Google Compute Engine API enabled, gcloud init allows you to choose a default Compute Engine zone:
Which compute zone would you like touseasproject default?
Please enter your numeric choice:
gcloud init confirms that you have complete the setup steps successfully:
gcloud has now been configured!
You can use[gcloud config]tochange moregcloud settings.
Your active configuration is: [default]
Copying Client and Server
QSpace is a high-performance position keeping system that combines start of the day positions with intraday trading activity to produce up to date positions that can be subscribed to by a multitude of clients. QGraph is a reactJS based client which subscribes to QSpace Server to display position and risk data.
To run qgraph client and qspace server on cloud instance we use 2 scripts:
test.sh->;Invoked manually andperforms steps(B)and(C);script.sh->;Invoked by test.shandperforms step(D)
This step is performed using the following commands in test.sh script: