Skip to content

Commit

Permalink
documentation update (#1238)
Browse files Browse the repository at this point in the history
also added some guard clauses to
build scripts to detect certain
required binaries are out there.

Signed-off-by: Volkan Özçelik <[email protected]>
  • Loading branch information
v0lkan authored Feb 2, 2025
1 parent 0341b9e commit 0483b66
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 63 deletions.
76 changes: 22 additions & 54 deletions core/log/rpc/generated/log.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 41 additions & 4 deletions docs/content/documentation/development/dev-env.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,49 @@ environment to be able to locally develop **VMware Secrets Manager**:
> [alternate setup](#alternate-non-minikube-setup-on-macos)
> section below.
## Docker on Linux

For Ubuntu Linux users, do not use `snap` to install Docker as it can create
permission problems when working with minikube.

Instead, try the following:

```bash
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg \
| sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg

# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker packages:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli \
containerd.io docker-buildx-plugin docker-compose-plugin

# Add your user to docker group:
sudo usermod -aG docker $USER
```

After this, you'll need to log out and log back in for the group changes
to take effect. This will give you a more reliable Docker setup that
integrates better with Minikube and other tools.

## Alternate Non-Minikube Setup on macOS

The rest of this document assumes that you are using **Minikube** and **Docker**;
however, if you are on a Mac, want to use **Docker for Mac's Kubernetes Distribution**,
you can install them as described below and skip the sections that are
specific to **Minikube**.
The rest of this document assumes that you are using **Minikube** and
**Docker**; however, if you are on a Mac, want to use**Docker for Mac's
Kubernetes Distribution**, you can install them as described below and skip
the sections that are specific to **Minikube**.

### Installing Docker for Mac

Expand Down
37 changes: 35 additions & 2 deletions docs/content/documentation/development/use-the-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,51 @@ title = "Use the Source"
weight = 10
+++

/*

For Ubuntu users; do not use snap to install docker as it can create
permission issues when working with minikube.
*/

## Introduction

This section describes how to build **VMware Secrets Manager** from source.

For a more detailed walkthrough about how to contribute to **VMware Secrets
Manager**, see the [**Contributing**](@/documentation/development/contributing.md) section.
Manager**, see the
[**Contributing**](@/documentation/development/contributing.md) section.

## Prerequisites

Make you have the following installed on your system:

* [`go`](https://go.dev/)
* [`make`](https://www.gnu.org/software/make/)
* [`git`](https://git-scm.com/)
* [`docker`](https://www.docker.com/)
* [`protoc`](https://grpc.io/docs/protoc-installation/)

## Ensure Your Environment Is Set Up

Make sure your Go environment is set up.

Here are some important environment settings that you might want
to double check:

```bash
go env

GO111MODULE=''
GOEXE=''
GONOPROXY=''
GONOSUMDB=''
GOPATH='/$USER/packages/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTOOLCHAIN='auto'
```

## Clone the Project

```bash
Expand Down Expand Up @@ -61,6 +90,10 @@ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
```

After installation ensure that `protoc-gen-go` and `protoc-gen-go-grpc` is
in your `$PATH`. If you set up your Go development enviornment, this should
already be the case.

## Updating Vendor Dependencies

If the project fails to build, you might need to update the vendor dependencies.
Expand Down
4 changes: 3 additions & 1 deletion docs/content/timeline/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ weight = 11

## Recent Changes

TBD
* Minor updates in the build scripts to check existence of prerequisites
before proceeding further, for better developer experience.
* Documentation updates.

## [0.28.1] - 2025-01-25

Expand Down
8 changes: 8 additions & 0 deletions hack/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ then
exit 1
fi

# Check if docker daemon is running by attempting docker ps
if ! docker ps &> /dev/null
then
echo "Docker daemon is not running or you don't have sufficient permissions."
echo "Please start the Docker daemon or check your Docker permissions."
exit 1
fi

# Change directory to the root of the git repository.
cd "$gitRoot" || exit 1

Expand Down
4 changes: 2 additions & 2 deletions hack/generate-proto-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

if ! command -v go &> /dev/null
then
echo "Go binary could not be found. Please install protoc first."
echo "Go binary could not be found. Please install go first."
exit 1
fi

if ! command -v protoc &> /dev/null
then
echo "protoc binary could not be found. Please install go first."
echo "protoc binary could not be found. Please install protoc first."
exit 1
fi

Expand Down
7 changes: 7 additions & 0 deletions hack/minikube-delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@
# >/' SPDX-License-Identifier: BSD-2-Clause
# */

# Check if minikube binary is present
if ! command -v minikube &> /dev/null
then
echo "Command 'minikube' not found. Please install Minikube first."
exit 1
fi

minikube delete
7 changes: 7 additions & 0 deletions hack/minikube-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
# >/' SPDX-License-Identifier: BSD-2-Clause
# */

# Check if minikube binary is present
if ! command -v minikube &> /dev/null
then
echo "Command 'minikube' not found. Please install Minikube first."
exit 1
fi

# Minikube might need additional flags for SPIRE to work properly.
# A bare-metal or cloud Kubernetes cluster will not need these extra configs.
minikube start \
Expand Down

0 comments on commit 0483b66

Please sign in to comment.