Skip to main content
Version: 2024

Google Cloud setup

Introduction to Google Cloud setup

This manual provides instructions for deploying Indicium dockerized in the Google Cloud Platform (GCP).

Prerequisites

Prerequisites for running Indicium dockerized in the GCP are:

RequiredMore information
SQL Server database with a deployed IAM databaseThe IAM (and Software Factory) database needs to be deployed on an accessible GCP SQL Server.
DockerDownload and install Docker. You can download the Docker installation package here.
Indicium (Universal)Download Indicium (Universal) from TCP.
A Google accountYou can create an account by opening the GCP home page when you have logged out.
A GCP projectFor more information, see Google's manual on Creating and managing projects.
Billing for your GCP projectFor more information, see Google's manual on billing for a project.
Local Cloud SDKAn 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.

  1. Create a new, local folder.

  2. In this folder, create:

    • A new folder called app.
    • A file without extension, called Dockerfile.

    folders The folder and file you should create

  3. Paste the downloaded Indicium files into the app folder.

  4. 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"]
  5. Open the app folder and open Indicium's appsettings.json file in a text editor.

  6. Copy and paste the meta source parameters for the Server (private IP) and Database (IAM database name). Use your created SQL account as PoolUsername and PoolPassword. 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

  1. Return to the main folder, type 'powershell' in the browser bar, and press Enter.

    open powershell Open Powershell

  2. Open your internet browser, browse to the Google Cloud Console, and log in with your account.

  3. Copy your Project ID from the Project info on the GCP main page.

    project id Copy your project ID

  4. 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

  1. In GCP, navigate to menu VPC network > Serverless VPC access. Enable it, select *Create connector, and create a new serverless VPC access connector.

  2. Enter a name and the following settings:

    vpc settings Name and settings for the new serverless VPC access connector

  3. Select Show scaling settings, add the following settings, and select Create.

    scaling settings Scaling settings

Create a cloud run service

  1. Return to the main menu and select Cloud run. Then select Create service to create a new Cloud Run service.

  2. In field Container image URL, select the pushed Indicium container.

  3. Scroll down and expand Container, Variables & Secrets, Connections, Security.

  4. In area General, field Container port, enter '8080'.

    cloud run service Settings for the Cloud Run service

    Scaling between the number of instances can lead to caching problems. Therefore:

  5. In area Autoscaling, enter '1' in field Minimum number of instances, so Indicium remains active and cannot scale down to 0 (zero) instances.

  6. Enter '1' in field Maximum number of instances, so Indicium cannot scale up to more instances.

  7. In area Authentication, allow unauthenticated invocations so the website can be approached externally.

  8. In area Capacity, field Memory, enter at least '1 GiB'.

    capacity Memory to allocate to each container instance

  9. Open tab Connections.

  10. Select Add connection to add your Cloud SQL instance.

  11. Select the newly created VPC Connector.

    connections Select the instance and connector

  12. Open tab Security and select Create a new service account from the Service account drow-down list.

  13. Enter a name for your service account and select Create.

    service account Create a new service account

  14. Select the service account roles Cloud SQL Admin and Cloud SQL Client. Then, select Done.

    roles Grant your service account access to the project

  15. Select the newly created service account from the drop-down list and select Deploy.

    deploy Deploy your service account

  16. 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.

check A green checkmark under Revisions

Was this page helpful?