Google Cloud Deployment
Introduction to Google Cloud
This manual provides instructions for deploying Indicium dockerized in the Google Cloud Platform (GCP).
Prerequisites
Prerequisites for running Indicium dockerized in the GCP are:
Required | More information |
---|---|
SQL Server database with a deployed IAM database | The IAM (and Software Factory) database needs to be deployed on an accessible GCP SQL Server. |
Docker | Download and install Docker. You can download the Docker installation package here. |
Indicium (Universal) | Download Indicium (Universal) from TCP. |
A Google account | You can create an account by opening the GCP home page when you have logged out. |
A GCP project | For more information, see Google's manual on Creating and managing projects. |
Billing for your GCP project | For more information, see Google's manual on billing for a project. |
Local Cloud SDK | An installed local Cloud SDK. For more information, see Google's manual on installing the Google Cloud CLI. |
1. Prepare Indicium
If all prerequisites are met, you can prepare Indicium for a dockerized run.
Create a new, local folder.
In this folder, create:
- A new folder called app.
- A file without extension, called Dockerfile.
The folder and file you should create
Paste the downloaded Indicium files into the app folder.
Open file Dockerfile in a text editor and add the following code. Then save and close the file:
FROM mcr.microsoft.com/dotnet/aspnet:5.0
ENV ASPNETCORE_URLS http://+:8080
EXPOSE 8080
WORKDIR /app
COPY ./app /app/
ENTRYPOINT ["dotnet", "Indicium.dll"]Open the app folder and open Indicium's appsettings.json file in a text editor.
Copy and paste the meta source parameters for the
Server
(private IP) andDatabase
(IAM database name). Use your created SQL account asPoolUsername
andPoolPassword
. You can find this data in your Google SQL instance. Then save and close the file.
"MetaSourceConnection": {
"Server": "your-private-sql-ip-address",
"Database": "your-iam-database-name",
"PoolUsername": "your-sql-account-username",
"PoolPassword": "your-sql-account-password"
}
2. Configuration in Google Cloud
Create a new docker image
Return to the main folder, type 'powershell' in the browser bar, and press Enter.
Open Powershell
Open your internet browser, browse to the Google Cloud Console, and log in with your account.
Copy your Project ID from the Project info on the GCP main page.
Copy your project ID
Return to the PowerShell and execute the following commands for the authentication with GCP from Docker, and to create and push a new docker image:
gcloud auth configure-docker
docker build -t gcr.io/your-project-ID/indicium .
docker push gcr.io/your-project-ID/indicium
Create a serverless VPC access connector
In GCP, navigate to menu VPC network > Serverless VPC access. Enable it, select *Create connector, and create a new serverless VPC access connector.
Enter a name and the following settings:
Name and settings for the new serverless VPC access connector
Select Show scaling settings, add the following settings, and select Create.
Scaling settings
Create a cloud run service
Return to the main menu and select Cloud run. Then select Create service to create a new Cloud Run service.
In field Container image URL, select the pushed Indicium container.
Scroll down and expand Container, Variables & Secrets, Connections, Security.
In area General, field Container port, enter '8080'.
Settings for the Cloud Run service
Scaling between the number of instances can lead to caching problems. Therefore:
In area Autoscaling, enter '1' in field Minimum number of instances, so Indicium remains active and cannot scale down to 0 (zero) instances.
Enter '1' in field Maximum number of instances, so Indicium cannot scale up to more instances.
In area Authentication, allow unauthenticated invocations so the website can be approached externally.
In area Capacity, field Memory, enter at least '1 GiB'.
Memory to allocate to each container instance
Open tab Connections.
Select Add connection to add your Cloud SQL instance.
Select the newly created VPC Connector.
Select the instance and connector
Open tab Security and select Create a new service account from the Service account drow-down list.
Enter a name for your service account and select Create.
Create a new service account
Select the service account roles Cloud SQL Admin and Cloud SQL Client. Then, select Done.
Grant your service account access to the project
Select the newly created service account from the drop-down list and select Deploy.
Deploy your service account
In the Cloud run's main screen, open the service. In tab Revisions, you can see a green checkmark when your revision is deployed successfully. To open and check the application, click on the URL at the top.
A green checkmark under Revisions