Skip to content

Commit

Permalink
Create workstation provisioning (#96)
Browse files Browse the repository at this point in the history
* Install git-filter-repo (#67)

* Build hypervisor iso using Packer with Bazel (#69)

* Rename Please BUILD files to BUILD.plz

* Working basic build of hypervisor image using packer in Bazel

* Download and run Lima through Bazel (#76)

* Download and run Lima through Bazel

* Run hypervisor image using lima

* Working "just hypervisor-run"!

* Added some documentation for lima_runtime

* Install Ignite using Pyinfra (#77)

* Install ignite dependencies using Pyinfra

* Set necessary environment variables in packer provisioner

* Working pyinfra command using Rlocation

* Working provision script without strict host key checking

* Run pyinfra provisioning during packer build

* Replace Lima with Vagrant for local development (#79)

* Created bazel rule to convert qcow to vagrant box

* Working runner_binary with working $rlocation

* Implement vagrant ssh key authentication

* Introduce vagrant toolchain for vagrant_run rule

* Use runner_binary for pyinfra_run as well

* Remove Lima

* Test hypervisor using InSpec (#80)

* Store the qcow image sha in the vagrant box info meta data

* Working inspec binary with rules_ruby

* Verify if ignite dependencies are installed

* Run and test the ignited service

* Remove packer user when done with provisioning

* Remove vagrant_run reference

* Run Hypervisor test in GitHub actions (#82)

* Run Hypervisor test in GitHub actions

* Add support for macos version of GitHub CI in Gemfile

* Ensure qemu is installed

* install coreutils

* Upload qemu logs

* Disable compression for the vagrant box to speed up build

* Fix rules_python chmod for local installation

* Remove debug info

* Simplify the bazelrc

* Fix hypervisor-test by disabling timer check in Qemu (#87)

* Fix hypervisor-test by disabling timer check in Qemu

* Update checksum for ubuntu focal image

* Enable debugging for all tools using SETUP_DEBUG=1 (#91)

* Nomad based Hypervisor (#92)

* Extract CNI and docker into own operations

* Install Nomad

* Install latest gems for inspec and kitchen

* Updated sha for kernel

* Install consul

* Install compatible envoy version for consul

* Introduce Home Assistant (#94)

* Added presence input for all rooms

* Force zigbee channel 11

* light and presence management in blueprints

* Added is_showering presence condition for bathroom

* Added google home entities

* Store 24 hours worth of traces for presence

* Use Homekit controller for Tado instead of Tado integration

* Added homekit entities

* Introduce adaptive_lighting and bedroom_is_sleeping behaviour

* Created animation for hallway lights

* Replace deluge with transmission (unrelated)

* Setup workstation bootstrap script to prevent sudo for asking password

* Setup entire skeleton for bootstrap script

* Basic provision script for workstation

* Prevent homebrew from updating existing packages

* Converted bathroom lights to zigbee control after installing shelly bypass

* Install config files for terminal

* Fix office light in Google Home

* Ensure proper ZSH is used by login shell

* Install vscode editor

* Ability to partially run pyinfra deploy

* Install languages for workstation

* Basic setup installing ssh

* Begin wiring 1password into workstation provision

* Deploy 1password connect api to hypervisor

* Connect pyinfra to 1password connect

* Working download of user_config

* Converted toilet lights to zigbee

* Added blitzwolf plugs

* Prevent light transition for toilet lights which sometimes stops the shelly

* Experiment with QOS 1 in hallway lights

* Remove bathroom_is_showering for now

* Working download single file from 1password

* Undo zigbee lights toilet for now

* WORKING installing of terminal

* Disable unnecessary global asdf languages

* Migrate terminal config to fig

* Create iTerm2 profile with updated colors and fonts

* Configure Snazzy color theme for terminal and VSCode

* Replace gpg with 1password for SSH authentication

* Add SSH based commit signing

* Add git change-commits

* Finish task

* Enable fuzzy search for atuin

* Working install_ssh provision run

* Restore asdf operation logic

* Created onepassword sync operation to download/upload secrets to 1Password

* Remove onepassword connect sdk

* Automatically install buildifier

* Install utilities

* Remove dotfiles directory

* Remove dotfiles test

* Created workstation test github action

* Force symlinks using home_link helper

* Use a fact for asdf plugins

* Disable onepassword in CI for now

* Ensure op command and better backup dir

* Restore onepassword sync

* Disable onepassword.sync in the CI for now

* WIP workflow deploy

* Introduce workflow deploy with macOS customisations

* Ensure we also install aws tools

* Install fig dotfiles

* Use homebrew prefix

* Install Fig while installing terminal

* Disable syncing dotfiles in the CI for Fig.io

* Fix workstation provisioning

* Also remove aws_completer

* Remove aws-okta because it's disabled in homebrew
  • Loading branch information
mvgijssel authored Sep 1, 2022
1 parent 84e7e89 commit 3187c1f
Show file tree
Hide file tree
Showing 87 changed files with 2,165 additions and 5,726 deletions.
1 change: 1 addition & 0 deletions .bazeliskrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
USE_BAZEL_VERSION=5.3.0
40 changes: 0 additions & 40 deletions .envrc

This file was deleted.

33 changes: 15 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,23 @@ jobs:
with:
access_token: ${{ github.token }}

test-dotfiles:
name: Test dotfiles
timeout-minutes: 60
runs-on: macos-latest
defaults:
run:
shell: bash -l {0}
workstation-test:
name: Workstation test
timeout-minutes: 30
runs-on: macos-10.15
steps:
- uses: actions/checkout@v1
- run: ./scripts/github_load_env.sh .envrc
- run: env
- run: |
export CI_PASSWORD=''
export BRANCH="$GIT_BRANCH"
eval "$(cat ./dotfiles/bootstrap.sh)" < <(echo $CI_PASSWORD)
- run: env
- working-directory: ${{ env.SETUP_DOTFILES_DIR }}
run: bundle install
- working-directory: ${{ env.SETUP_DOTFILES_DIR }}
run: bundle exec rspec
- uses: pat-s/[email protected]
id: bazel-cache
with:
path: |
cache/bazel_cache
cache/bazel_repository_cache
key: bazel-cache-${{ runner.os }}-${{ github.job }}-${{ github.sha }}
restore-keys: bazel-cache-${{ runner.os }}-${{ github.job }}-
# removing the aws CLI so it can be installed by the workstation provisioning
- run: rm /usr/local/bin/aws /usr/local/bin/aws_completer
- run: bazel run //workstation:provision

hypervisor-test:
name: Hypervisor test
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,8 @@ mutagen.yml.lock
/home-assistant/zigbee2mqtt-data/*
!/home-assistant/zigbee2mqtt-data/configuration.yaml

/home-assistant/z-stack-firmware/*
/home-assistant/z-stack-firmware/*

.env

.DS_Store
11 changes: 11 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp

// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"vspacecode.vspacecode",
"alexanderbast.vscode-snazzy",
"BazelBuild.vscode-bazel"
],
}
8 changes: 3 additions & 5 deletions 1password/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ services:
ports:
- "8090:8080"
volumes:
- "./1password-credentials.json:/home/opuser/.op/1password-credentials.js\
on"
- "./1password-credentials.json:/home/opuser/.op/1password-credentials.json"
- "data:/home/opuser/.op/data"

op-connect-sync:
image: 1password/connect-sync:latest
ports:
- "8091:8080"
- "127.0.0.1:8091:8080"
volumes:
- "./1password-credentials.json:/home/opuser/.op/1password-credentials.js\
on"
- "./1password-credentials.json:/home/opuser/.op/1password-credentials.json"
- "data:/home/opuser/.op/data"

volumes:
Expand Down
21 changes: 10 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ load("//tools/packer:repositories.bzl", "rules_packer_toolchains")

bazel_skylib_workspace()

rules_packer_toolchains(
version = "1.8.0",
)
# TODO: no binary available for M1!
# rules_packer_toolchains(
# version = "1.8.0",
# )

# https://cloud-images.ubuntu.com/focal/current/unpacked/
http_file(
Expand Down Expand Up @@ -49,21 +50,19 @@ http_file(

http_archive(
name = "rules_python",
patch_args = ["-p1"],
patches = ["@//tools/python:fix-chmod.patch"],
sha256 = "9fcf91dbcc31fde6d1edb15f117246d912c33c36f44cf681976bd886538deba6",
strip_prefix = "rules_python-0.8.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.8.0.tar.gz",
sha256 = "b593d13bb43c94ce94b483c2858e53a9b811f6f10e1e0eedc61073bd90e58d9c",
strip_prefix = "rules_python-0.12.0",
url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.12.0.tar.gz",
)

load("@rules_python//python:repositories.bzl", "python_register_toolchains")

python_register_toolchains(
name = "python3_9",
python_version = "3.9",
name = "python3_10",
python_version = "3.10",
)

load("@python3_9//:defs.bzl", "interpreter")
load("@python3_10//:defs.bzl", "interpreter")
load("@rules_python//python:pip.bzl", "pip_parse")

pip_parse(
Expand Down
2 changes: 0 additions & 2 deletions dotfiles/.rspec

This file was deleted.

Loading

0 comments on commit 3187c1f

Please sign in to comment.