cloudify-cosmo / backstage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

backstage

backstage.io installation info

Backstage POC deployment requirements

Secrets

Before deploying the Backstage POC setup from backstage blueprint, setup the following secrets in your Cloudify Manager:

  • LICENSE - with the contents of a valid Cloudify license used for Cloudify Manager
  • aws_access_key_id - Access Key ID of your AWS account
  • aws_secret_access_key - Secret Access Key of your AWS account
  • aws_access_key_id_dev - Access Key ID of your dev AWS account with AWS Cost Explorer permissions
  • aws_secret_access_key_dev - Secret Access Key of your dev AWS account with AWS Cost Explorer permissions
  • aws_access_key_id_prod - Access Key ID of your prod AWS account with AWS Cost Explorer permissions
  • aws_secret_access_key_prod - Secret Access Key of your prod AWS account with AWS Cost Explorer permissions
  • github_token - GitHub Token generated for your GitHub user
  • github_username - your GitHub account user name
  • postgres_password - password that will be used for PostgreSQL database

Additionally, the following secrets will be created during the deployment lifecycle:

  • backstage_vm_ssh_key_private
  • backstage_vm_ssh_key_public
  • cloudify_manager_vm_ssh_key_private
  • cloudify_manager_vm_ssh_key_public
  • github_runner_vm_ssh_key_private
  • github_runner_vm_ssh_key_public

Those secrets names can be changed in the backstage blueprint.

Plugins

Upload following plugins to your Cloudify Manager:

  • cloudify-aws-plugin
  • cloudify-fabric-plugin
  • cloudify-utilities-plugin

VM requirements

CPUs ?

RAM 8GB

Storage ?

Install prerequisites

Installation instructions https://backstage.io/docs/getting-started/running-backstage-locally

Go to dir for backstage installation

cd

NodeJS LTS

curl -sL https://rpm.nodesource.com/setup_16.x | sudo bash -

sudo yum install -y nodejs

yarn

sudo npm install --global yarn

Docker

sudo yum install -y yum-utils
sudo yum-config-manager \
  --add-repo \
  https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker

sudo usermod -aG docker $USER

git

sudo yum install -y git

Python3

sudo yum install -y python3

SCL (needed for new g++)

sudo yum install -y centos-release-scl
sudo yum install -y llvm-toolset-7.0
sudo yum install -y llvm-toolset-7.0-cmake
sudo yum install -y devtoolset-8

scl enable devtoolset-8 bash
scl enable llvm-toolset-7.0 bash

Install from npm (interactive)

npx @backstage/create-app
cd my-backstage-app
yarn dev

Install for dev

Clone and build

git clone https://github.com/backstage/backstage.git
cd backstage
git checkout v1.0.3

Node options

Needed for yarn tsc

export NODE_OPTIONS=--max_old_space_size=4096

Install and setup service

yarn install
yarn tsc
yarn build


IP=$(hostname -I | awk '{print $1}') sh -c 'sed "s,baseUrl: http://localhost:3000,baseUrl: http://${IP}:3000,g" -i app-config.yaml'

sudo sh -c 'cat <<EOF > /etc/systemd/system/backstagebackend.service
[Unit]
Description=Backstage backend

[Service]
WorkingDirectory=${PWD}/packages/backend
ExecStart=/usr/bin/yarn start

Restart=always

[Install]
WantedBy=multi-user.target
EOF'

sudo sh -c 'cat <<EOF > /etc/systemd/system/backstagefrontend.service
[Unit]
Description=Backstage frontent

[Service]
WorkingDirectory=${PWD}
ExecStart=/usr/bin/yarn start

Restart=always

[Install]
WantedBy=multi-user.target
EOF'

sudo systemctl enable backstagebackend
sudo systemctl enable backstagefrontend
sudo systemctl start backstagebackend
sudo systemctl start backstagefrontend

Optional components

Postgresql

sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql12 postgresql12-server
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb

sudo systemctl start postgresql-12
sudo systemctl enable postgresql-12

Postgres config

sudo -u postgres psql -c  "ALTER USER postgres PASSWORD 'secret';"

Backstage psql config

cd packages/backend
yarn add pg

Adjust config: https://backstage.io/docs/getting-started/configuration

update postgres conf

in file /var/lib/pgsql/12/data/pg_hba.conf change host all all 127.0.0.1/32 idnet to host all all 127.0.0.1/32 md5

sudo systemctl restart postgresql-12

About


Languages

Language:Shell 100.0%