Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: local cluster on macOS arm64 #962

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
74c248b
chore: wip
minikin Aug 29, 2024
9b84757
Update Readme.md
minikin Aug 30, 2024
65b9b3b
Merge branch 'main' into feat/fix-local-cluster-macos
minikin Sep 3, 2024
e6bd6f0
chore: wip
minikin Sep 4, 2024
99bbc83
feat: add vmware_fusion
minikin Sep 6, 2024
8fc0e42
chore: restore local_path_provisioner_script
minikin Sep 6, 2024
f54f593
Update Vagrantfile
minikin Sep 6, 2024
b29deb8
Update Vagrantfile
minikin Sep 7, 2024
f6e8808
Merge branch 'main' into fix/temp-macos
minikin Oct 4, 2024
c5ee210
utils: wip
minikin Oct 4, 2024
519a5b0
Merge branch 'main' into fix/local-cluster-macos-arm64
minikin Oct 4, 2024
6bdfba5
chore: wip
minikin Oct 4, 2024
c62cc5f
Merge branch 'main' into fix/temp-macos
minikin Oct 4, 2024
275b1d9
Merge branch 'main' into fix/local-cluster-macos-arm64
minikin Oct 8, 2024
b3fe0bb
chore: qemu wip
minikin Oct 9, 2024
9a668be
feat: add parallels as provider
minikin Oct 9, 2024
486faa9
Merge branch 'main' into fix/local-cluster-macos-arm64
minikin Oct 9, 2024
c5ef98f
Update Readme.md
minikin Oct 9, 2024
51930f5
Update Readme.md
minikin Oct 9, 2024
8258564
Update Readme.md
minikin Oct 9, 2024
f2c79c5
chore: clean up cspell
minikin Oct 9, 2024
ac0a954
Update project.dic
minikin Oct 9, 2024
b8fab5a
Update project.dic
minikin Oct 9, 2024
f310e90
Update Readme.md
minikin Oct 9, 2024
43feb71
Update project.dic
minikin Oct 9, 2024
88ea242
Update Vagrantfile
minikin Oct 9, 2024
4f1a4ad
Merge branch 'main' into fix/local-cluster-macos-arm64
minikin Oct 10, 2024
17c61fd
Merge branch 'main' into fix/temp-macos
minikin Oct 11, 2024
3525745
Merge branch 'main' into fix/temp-macos
minikin Oct 14, 2024
8ecfcf1
Merge branch 'main' into fix/temp-macos
minikin Oct 15, 2024
ebc05f7
Merge branch 'main' into fix/temp-macos
minikin Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .config/dictionaries/project.dic
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ autorecalculates
autoresizing
backendpython
bech
bento
bimap
bindgen
bkioshn
Expand Down Expand Up @@ -51,6 +52,7 @@ codepoints
commitlog
coti
coverallsapp
cpu
CQLSH
cryptoxide
Cunego
Expand Down Expand Up @@ -106,21 +108,25 @@ icudtl
ideascale
idents
ilap
inotify
Instantitation
integ
Intellij
interps
inversed
iohk
iphoneos
iscsi
jdbc
jetbrains
jetstack
Joaquín
jorm
jormungandr
Jörmungandr
junitreport
junitxml
justfile
Keyhash
keychains
keyserver
Expand Down Expand Up @@ -171,6 +177,7 @@ netifas
netkey
nextest
Nodetool
noninteractive
OCSP
Oleksandr
onboarded
Expand All @@ -190,6 +197,7 @@ postcss
Pozhylenkov
Precache
Precertificate
preconfiguration
preprod
projectcatalyst
Prokhorenko
Expand Down Expand Up @@ -272,6 +280,7 @@ Unstaked
UTXO
Utxos
varint
vcpu
Vespr
vite
vitss
Expand All @@ -297,4 +306,4 @@ xctest
xctestrun
xcworkspace
xvfb
yoroi
yoroi
176 changes: 157 additions & 19 deletions utilities/local-cluster/Readme.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
# Local Cluster

* [Local Cluster](#local-cluster)
* [Requirements](#requirements)
* [Cluster Architecture](#cluster-architecture)
* [Default Services](#default-services)
* [Scylla DB](#scylla-db)
* [Deploying the Cluster](#deploying-the-cluster)
* [Setup hosts on Windows](#setup-hosts-on-windows)
* [Startup](#startup)
* [Linux/Windows](#linuxwindows)
* [macOS](#macos)
* [Getting Basic Cluster details](#getting-basic-cluster-details)
* [Suspending the Cluster](#suspending-the-cluster)
* [Resuming a suspended the Cluster](#resuming-a-suspended-the-cluster)
* [Stopping the Cluster](#stopping-the-cluster)
* [Catalyst Voices Services](#catalyst-voices-services)
* [Deploying Catalyst Voices Frontend and Backend Services](#deploying-catalyst-voices-frontend-and-backend-services)
* [Deploying Catalyst Voices Documentation Service](#deploying-catalyst-voices-documentation-service)
* [Debugging the cluster](#debugging-the-cluster)
* [SSH into a running VM](#ssh-into-a-running-vm)
* [Local UI to access ScyllaDB](#local-ui-to-access-scylladb)
* [Troubleshooting](#troubleshooting)
* [Issues with Vagrant configurations](#issues-with-vagrant-configurations)
* [Issues with running command with just](#issues-with-running-command-with-just)
* [Vagrant cannot forward the specified ports on a VM](#vagrant-cannot-forward-the-specified-ports-on-a-vm)
* [Check if Port 6443 is in Use](#check-if-port-6443-is-in-use)
* [List all running Vagrant VMs to see if any are currently active](#list-all-running-vagrant-vms-to-see-if-any-are-currently-active)
* [Halt or Destroy the Existing VM](#halt-or-destroy-the-existing-vm)
* [Kill the VM Process Manually (If Necessary)](#kill-the-vm-process-manually-if-necessary)
* [Confirm the Process is Terminated](#confirm-the-process-is-terminated)

## Requirements

Integration Tests and local testing will require a running local cluster.
To eliminate variability and simplify local deployment, we have standardized the local cluster around:

* [VirtualBox](https://www.virtualbox.org/)
* [VirtualBox](https://www.virtualbox.org/) for Linux or [Parallels](https://www.parallels.com/) for macOS
* [Vagrant](https://developer.hashicorp.com/vagrant/install?product_intent=vagrant)
* [kubectl](https://kubernetes.io/docs/tasks/tools/)
* [helm](https://helm.sh/docs/intro/install/)

These tools allow us to define VMs that are consistent and provide a uniform Kubernetes environment
for local testing.
* [just](https://github.com/casey/just)

## Cluster Architecture

Expand Down Expand Up @@ -56,14 +86,14 @@ For testing purposes, the ScyllaDB is accessible on the Cluster IP Address: `192

### Setup hosts on Windows

On Windows, you need to set up the hosts before starting the cluster
From the Windows terminal to open the hosts file:
On Windows you need to setup the hosts before starting the cluster
From Windows terminal open the hosts file:

```sh
notepad %SystemRoot%\System32\drivers\etc\hosts
```
notepad %SystemRoot%\System32\drivers\etc\hosts
```

and copy the hosts from `./shared/extra.hosts` into the Windows host file
and copy the hosts from `./shared/extra.hosts` into the Windows host file

### Startup

Expand Down Expand Up @@ -176,13 +206,13 @@ vagrant ssh agent99

Found (and tested) description how to connect using only open-source via DBeaver:

1. Download DBeaver (Community Edition)
2. Download Cassandra JDBC jar files: <http://www.dbschema.com/cassandra-jdbc-driver.html>
1. Download dbeaver (Community Edition) [dbeaver](https://dbeaver.io/download)
2. Download cassandra jdbc jar files: [cassandra-jdbc-drive](http://www.dbschema.com/cassandra-jdbc-driver.html)
(Downloading and Testing the Driver Binaries section have links to binary and source)
3. extract Cassandra JDBC zip
4. run DBeaver
5. go to Database > Driver Manager
6. click New
3. Extract Cassandra JDBC zip
4. Run DBeaver
5. Go to `Database` > `Driver Manager`
6. Click `New`
7. Fill in details as follows:
* Driver Name: `Cassandra` (or whatever you want it to say)
* Driver Type: `Generic`
Expand All @@ -192,7 +222,115 @@ Found (and tested) description how to connect using only open-source via DBeaver
* Embedded: `no`
* Category:
* Description: `Cassandra` (or whatever you want it to say)
8. click Add File and add all the jars in the Cassandra JDBC zip file.
9. click Find Class to make sure the Class Name is found okay
10. click OK
11. Create New Connection, selecting the database driver you just added
8. Click Add File and add all the jars in the Cassandra JDBC zip file.
9. Click Find Class to make sure the Class Name is found okay.
10. Click `OK`.
11. Create `New Connection`, selecting the database driver you just added.

## Troubleshooting

### Issues with Vagrant configurations

If you encounter any weird issues with the Vagrant, you can try the following:

```sh
rm -rf .vagrant
```

and then restart the cluster.

### Issues with running command with just

If you encounter any issues with running the commands with `just`,
you can try running the commands directly.

Instead of:

```sh
just stop-cluster
```

run:

```sh
vagrant destroy -f
```

For more see [justfile](./justfile)

### Vagrant cannot forward the specified ports on a VM

#### Check if Port 6443 is in Use

```sh
sudo lsof -i :6443
```

You can see the output like this:

```sh
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
parallels-syst 42886 username 19u IPv4 0x9af1245915ca3e76 0t0 TCP *:sun-sr-https (LISTEN)
```

The process parallels-syst, with PID 42886, is listening on port 6443.
This means that a parallels virtual machine (can be VirtualBox) is currently running and using port 6443 on your host machine.

Since you’re using the VirtualBox/Parallels provider with Vagrant
it’s likely that an existing VM is still running and occupying port 6443.
This is preventing your new Vagrant VM from forwarding port 6443, resulting in the error

#### List all running Vagrant VMs to see if any are currently active

```sh
vagrant global-status
```

This command will list all Vagrant environments on your system.
Look for any VMs that are in the running state.

```sh
id name provider state directory
--------------------------------------------------------------------------------------
abcd123 control parallels running /path/to/your/project
abcd456 other parallels running /another/project
```

#### Halt or Destroy the Existing VM

If you find that a VM is running that you no longer need, you can halt or destroy it.

**To halt the VM:**

```sh
vagrant halt <id>
```

**To destroy the VM:**

```sh
vagrant destroy <id>
```

Replace ID with the ID of the VM from the vagrant global-status output.
For example: `vagrant halt abcd123`

#### Kill the VM Process Manually (If Necessary)

If the VM is not managed by Vagrant, or if it did not shut down properly,
you may need to kill the VM process manually.

```sh
kill 42886
```

Replace 42886 with the PID from your lsof output.

#### Confirm the Process is Terminated

```sh
sudo lsof -i :6443
```

This should return no output, indicating that no process is listening on port 6443.
Retry bringing up the Vagrant VM
Loading
Loading