Skip to content

modell-aachen/modac-dev-machine-setup

Repository files navigation

Required packages

MacOS: Please start with MacOS required packages.

The machine provisioner requires some basic packages. If your using ubuntu >= 20.04, you can follow along with the "Usage" section. On other operating system, i.e. MacOS, please satisfy the following requirements manually:

  • python >= 3.10
  • pip >= 20.3
  • pip3 >= 20.3
  • git
  • vim

Important The command python3 needs to point to the python-executable for Python >= 3.10, python might not work.

Usage

Preparations

sudo apt update
sudo apt install -y software-properties-common git vim python3 python3-pip python-is-python3
cd ~

Install and configure 1Password

As preparation you need to install 1password CLI and be able to login. Follow the instructions here: https://developer.1password.com/docs/cli/get-started

After following the instructions you should be able to run

op vault list

and see a list of your vaults.

Setup python pip

For newer Ubuntu versions (>=24.04) you need to allow pip to install global packages:

sudo -H pip3 config --global set global.break-system-packages true

Inventory creation

Clone repo

git clone https://github.com/modell-aachen/modac-dev-machine-setup.git

Create inventroy blueprint

For development users

cp $HOME/modac-dev-machine-setup/provisioning/inventory_custom_example.yml $HOME/.inventory_local.yml

For service users

cp $HOME/modac-dev-machine-setup/provisioning/inventory_service_example.yml $HOME/.inventory_local.yml

Initial local configuration and adjustments

vim $HOME/.inventory_local.yml
  1. remove unused packages and snaps, insert your keys, e.g.
  2. create a local ssh key and set as SSH key to your GitHub Account (https://github.com/settings/keys)
  3. check successfull authentication against github.com
  4. create a directory for your repositories and set REPOS_DIRECTORY to the created path
  5. set NEXUS_BOT_TOKEN to the value of 1Password entry at https://start.1password.com/open/i?a=CXJNQFCHNNGSLNOEP6SLPHLZQ4&v=3mhbwhicfwkifyq7bc2nrnhywa&i=32jtgjyel43vabz2wbukslo5bq&h=modac.1password.eu

Additional, development only, configuration and adjustments

  1. set GITHUB_AUTH_TOKEN to the value of 1Password entry at https://start.1password.com/open/i?a=CXJNQFCHNNGSLNOEP6SLPHLZQ4&h=modac.1password.eu&i=dwpktyrfuj6cyjfy6y74q3ifiy&v=6u4nznoclnkg7467ne4ntutcgq
  2. set FONTAWESOME_NPM_AUTH_TOKEN to the value of 1Password entry at https://start.1password.com/open/i?a=CXJNQFCHNNGSLNOEP6SLPHLZQ4&h=modac.1password.eu&i=xmhedekcuokrqrch62bsuvr5lu&v=6u4nznoclnkg7467ne4ntutcgq
  3. set FONTAWESOME_NEXUS_AUTH_TOKEN to the value of 1Password entry at https://start.1password.com/open/i?a=CXJNQFCHNNGSLNOEP6SLPHLZQ4&v=6u4nznoclnkg7467ne4ntutcgq&i=5xls52q24au3eie2itucvc635u&h=modac.1password.eu
  4. set HARBOR_USERNAME to your modac mail address
  5. set HARBOR_PASSWORD to your CLI token (https://harbor.modac.cloud -> Login -> user profile [top right corner] -> User Profile -> CLI secret)

Initial setup

cd $HOME/modac-dev-machine-setup/
./dev-provision -i ~/.inventory_local.yml

After that open up a new terminal to have an updated PATH with all the tools available.

Updates

Update your $HOME/.inventory_local.yml:

machine edit-config

Apply updates:

machine provision

FAQ

Problem lösen "GitHub Error Message - Permission denied (publickey)"

Source: https://stackoverflow.com/questions/12940626/github-error-message-permission-denied-publickey Solution: Write that before starting the script

ssh-agent -s
ssh-add ~/.ssh/id_rsa

DNS resolver

Local Q.wiki (e.g. dev.modac) can't be resolved ( < Ubuntu 21.04 only):

sudo systemctl restart lxd-host-dns.service

ZSH

If you use zsh, source .env and bashrc.sh in your .zshrc

[ -f $HOME/.env ] && source $HOME/.env
[ -f $HOME/.modac-bash/bashrc.sh ] && source $HOME/.modac-bash/bashrc.sh

Docker setup fails

The docker task requires a system restart. If any succeeding docker-related tasks fail (kubectl, calico, etc.) try restarting the system and the provisioning process (machine provision).

Calico: ImageInspectError

The calico task can fail because of an incompatibility issue:

Workaround:

apt-cache policy docker-ce | grep 24.0.7

Use the printed version (e.g. 5:24.0.7-1ubuntu.22.04jammy) to ...

sudo apt install docker-ce=*VERSION*

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published