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

🌱 mac setup steps #938

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
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
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,29 @@ For a more complete overview of OLM v1 and how it differs from OLM v0, see our [

## Getting Started
You’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.
**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).

> [!NOTE]
> Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).

### Additional setup on Machintosh computers
On Macintosh computers some additional setup is necessary to install and configure compatible tooling.

#### Install Homebrew and tools
Follow the instructions to [installing Homebrew](https://docs.brew.sh/Installation) and then execute the following to install tools:

```sh
brew install bash gnu-tar gsed
```

#### Configure your shell
Modify your login shell's `PATH` to prefer the new tools over those in the existing environment. This example should work either with `zsh` (in $HOME/.zshrc) or `bash` (in $HOME/.bashrc):

```sh
for bindir in `find $(brew --prefix)/opt -type d -follow -name gnubin -print`
Copy link
Member

@m1kola m1kola Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I normally try to avoid running commands in .zshrc because it can slow down creation of a new session significantly. Maybe it is not that big of a deal with brew --prefix and find, but I had this issue with npm.

If we can avoid this - that would be great. Here is my .zshrc:

# coreutils
PATH="/opt/homebrew/opt/coreutils/libexec/gnubin:$PATH"

# gnu-tar
PATH="/opt/homebrew/opt/gnu-tar/libexec/gnubin:$PATH"

Not sure if coreutils are necessary for OLMv1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we might still need to use brew --prefix. I think it it is different on Intel and ARM Macs unfortunately.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been doing this for quite awhile never encountered new session timing issues, though I appreciate the concern. The additional advantage of the approach is that if we identify we need additional tooling, sourcing the resource file will automagically pick it up.

npm is known for sometimes performing package maintenance at awkward times, and I definitely wouldn't want to include a function in shell resources which invoked it. I see no harm in a targeted path-walk though.

As far as I know we only need bash, gnu-tar, and gsed, unless you can think of a reason that we need coreutils...

Copy link
Member

@m1kola m1kola Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find $(brew --prefix)/opt -type d -follow -name gnubin -print  0,01s user 0,10s system 96% cpu 0,112 total

Ok, it is not that bad. At least on my machine :)

do
export PATH=$bindir:$PATH
done
```

### Running on the cluster
1. Install Instances of Custom Resources:
Expand Down
Loading