Skip to content

Commit

Permalink
feat: changed BOLT_CUSTOM_DOMAIN to GRANICA_CUSTOM_DOMAIN (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
dskart committed Jun 6, 2023
1 parent c30ec05 commit c19ff28
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 22 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Sidekick is a [sidecar](https://learn.microsoft.com/en-us/azure/architecture/pat
In order to run sidekick, you first need to set some ENV variables

```bash
export BOLT_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN>
export GRANICA_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN>
# Optional if not running on a ec2 instance or running in a different region
export AWS_REGION=<YOUR_BOLT_CLUSTER_REGION>
# Optional if not running on a ec2 instance to force read from a read-replica in this az
Expand Down Expand Up @@ -73,21 +73,21 @@ or pull one from the [containers page](https://github.com/project-n-oss/sidekick
#### Running on an EC2 Instance using instance profile credentials

```bash
docker run -p 7075:7075 --env BOLT_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN> -env AWS_REGION=<YOUR_BOLT_CLUSTER_REGION> <sidekick-image> sidekick serve
docker run -p 7075:7075 --env GRANICA_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN> -env AWS_REGION=<YOUR_BOLT_CLUSTER_REGION> <sidekick-image> sidekick serve
```

#### Running on any machine using environment variable credentials

```bash
docker run -p 7075:7075 --env BOLT_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN> -env AWS_REGION=<YOUR_BOLT_CLUSTER_REGION> --env AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY> --env AWS_SECRET_ACCESS_KEY="<YOUR_AWS_SECRET_KEY>" <sidekick-image> serve -v
docker run -p 7075:7075 --env GRANICA_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN> -env AWS_REGION=<YOUR_BOLT_CLUSTER_REGION> --env AWS_ACCESS_KEY_ID=<YOUR_AWS_ACCESS_KEY> --env AWS_SECRET_ACCESS_KEY="<YOUR_AWS_SECRET_KEY>" <sidekick-image> serve -v
```

If using temporary credentials, add `--env AWS_SESSION_TOKEN=<YOUR_SESSION_TOKEN>` to the command above. However, this is not recommended since credentials will expire. Instead consider using the credentials profiles file with role assumption directives.

#### Running on any machine using the credential profiles file

```bash
docker run -p 7075:7075 --env BOLT_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN> --env AWS_REGION=<YOUR_BOLT_CLUSTER_REGION> -v ~/.aws/:/root/.aws/ <sidekick-image> serve
docker run -p 7075:7075 --env GRANICA_CUSTOM_DOMAIN=<YOUR_CUSTOM_DOMAIN> --env AWS_REGION=<YOUR_BOLT_CLUSTER_REGION> -v ~/.aws/:/root/.aws/ <sidekick-image> serve
```

By default, the `default` profile from the credentials file will be used. If you want to use another profile from the credentials file add `--env AWS_DEFAULT_PROFILE=<YOUR_PROFILE>` to the command above.
Expand Down
9 changes: 7 additions & 2 deletions boltrouter/bolt_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,14 @@ func newBoltVars(ctx context.Context, logger *zap.Logger) (*BoltVars, error) {
}
ret.ZoneId.Set(awsZoneId)

boltCustomDomain, ok := os.LookupEnv("BOLT_CUSTOM_DOMAIN")
var boltCustomDomain string
boltCustomDomain, ok := os.LookupEnv("GRANICA_CUSTOM_DOMAIN")
if !ok {
return nil, fmt.Errorf("BOLT_CUSTOM_DOMAIN env variable is not set")
// Keeping this for backwards compatibility
boltCustomDomain, ok = os.LookupEnv("BOLT_CUSTOM_DOMAIN")
if !ok {
return nil, fmt.Errorf("GRANICA_CUSTOM_DOMAIN or BOLT_CUSTOM_DOMAIN env variable is not set")
}
}
ret.BoltCustomDomain.Set(boltCustomDomain)
ret.BoltHostname.Set(fmt.Sprintf("bolt.%s.%s", ret.Region.Get(), ret.BoltCustomDomain.Get()))
Expand Down
2 changes: 1 addition & 1 deletion boltrouter/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
func TestMain(m *testing.M) {
os.Setenv("AWS_REGION", "us-east-1")
os.Setenv("AWS_ZONE_ID", "use1-az1")
os.Setenv("BOLT_CUSTOM_DOMAIN", "test.bolt.projectn.co")
os.Setenv("GRANICA_CUSTOM_DOMAIN", "test.bolt.projectn.co")

exitVal := m.Run()
os.Exit(exitVal)
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Create a `.env` file in `sidekick/integration_tests`:
BUCKET=<YOUR_BUCKET>
FAILOVER_BUCKET=<YOUR_FAILOVER_BUCKET>
FAILOVER_BUCKET_DIFF_REGION=<YOUR_FAILOVER_BUCKET_DIFF_REGION>
BOLT_CUSTOM_DOMAIN=<YOUR_CLUSTER_DOMAIN>
GRANICA_CUSTOM_DOMAIN=<YOUR_CLUSTER_DOMAIN>
```

You can run test from this directory using the following command:
Expand Down
6 changes: 3 additions & 3 deletions integrations/cyberduck/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ Right-click on the downloaded file in the File Explorer and click "Extract All".

Before running the executable, make sure the following environment variables are set:

- `BOLT_CUSTOM_DOMAIN`: This is the custom domain you chose during setup.
- `GRANICA_CUSTOM_DOMAIN`: This is the custom domain you chose during setup.
- `AWS_REGION`: This is the region of your Bolt deployment.

**macOS**

```bash
export BOLT_CUSTOM_DOMAIN="your-custom-domain.com"
export GRANICA_CUSTOM_DOMAIN="your-custom-domain.com"
export AWS_REGION="your-bolt-region"
```

**Windows**

```bash
set BOLT_CUSTOM_DOMAIN=your-bolt-domain.com
set GRANICA_CUSTOM_DOMAIN=your-bolt-domain.com
set AWS_REGION=your-bolt-region
```

Expand Down
12 changes: 6 additions & 6 deletions integrations/databricks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ You need to allow vpc peering from your databricks vpc to the bolt vpc. You can

## Configuration

In order for sidekick to work with you clusters, you need define the `BOLT_CUSTOM_DOMAIN` environment variable and edit spark s3 hadoop plugin to point bucket endpoints to sidekick.
In order for sidekick to work with you clusters, you need define the `GRANICA_CUSTOM_DOMAIN` environment variable and edit spark s3 hadoop plugin to point bucket endpoints to sidekick.

These can be configured in two ways:

Expand All @@ -24,26 +24,26 @@ cat >/databricks/driver/conf/sidekick-spark-conf.conf <<EOL
EOL
```

You can also define the `BOLT_CUSTOM_DOMAIN` by adding this line in the script:
You can also define the `GRANICA_CUSTOM_DOMAIN` by adding this line in the script:

```bash
export BOLT_CUSTOM_DOMAIN=<YOUR_CUSTOM_BOLT_DOMAIN>
export GRANICA_CUSTOM_DOMAIN=<YOUR_CUSTOM_BOLT_DOMAIN>
```

### Cluster base configuration

You can also set the bucket endpoints and `BOLT_CUSTOM_DOMAIN` by changing you cluster settings.
You can also set the bucket endpoints and `GRANICA_CUSTOM_DOMAIN` by changing you cluster settings.

You can use the [spark configuration](https://docs.databricks.com/clusters/configure.html#spark-configuration) option in your cluster settings to set the bucket endpoints:

```
spark.hadoop.fs.s3a.bucket.<MY_BUCKET>.endpoint http://localhost:7075
```

You can then also use the [env configuration](https://docs.databricks.com/clusters/configure.html#environment-variables) option in your cluster settings to set the `BOLT_CUSTOM_DOMAIN`.
You can then also use the [env configuration](https://docs.databricks.com/clusters/configure.html#environment-variables) option in your cluster settings to set the `GRANICA_CUSTOM_DOMAIN`.

```
BOLT_CUSTOM_DOMAIN=<YOUR_CUSTOM_BOLT_DOMAIN>
GRANICA_CUSTOM_DOMAIN=<YOUR_CUSTOM_BOLT_DOMAIN>
```


Expand Down
2 changes: 1 addition & 1 deletion integrations/databricks/sidekick_service_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ cat > $SERVICE_FILE << EOF
Description=Sidekick service file
[Service]
Environment=BOLT_CUSTOM_DOMAIN=$BOLT_CUSTOM_DOMAIN
Environment=GRANICA_CUSTOM_DOMAIN=$GRANICA_CUSTOM_DOMAIN
ExecStart=$SIDEKICK_BIN serve -p 7075
Restart=always
Expand Down
2 changes: 1 addition & 1 deletion integrations/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To get started, you will need to configure your SideKick sidecar container. A sa

Additionally, the following environment variables must be set:

* `BOLT_CUSTOM_DOMAIN`: This is the custom domain you chose during setup.
* `GRANICA_CUSTOM_DOMAIN`: This is the custom domain you chose during setup.
* `AWS_REGION`: This is the region of your Bolt deployment.


Expand Down
2 changes: 1 addition & 1 deletion integrations/kubernetes/sidekick_sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
image: ghcr.io/project-n-oss/sidekick:latest
command: ["sidekick", "serve"]
env:
- name: BOLT_CUSTOM_DOMAIN
- name: GRANICA_CUSTOM_DOMAIN
value: km.bolt.projectn.co
- name: AWS_REGION
value: us-east-1
Expand Down
4 changes: 2 additions & 2 deletions integrations/s3browser/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Right-click on the downloaded file in the File Explorer and click "Extract All".

Before running the executable, make sure the following environment variables are set:

- `BOLT_CUSTOM_DOMAIN`: This is the custom domain you chose during setup.
- `GRANICA_CUSTOM_DOMAIN`: This is the custom domain you chose during setup.
- `AWS_REGION`: This is the region of your Bolt deployment.

**Windows**

```bash
set BOLT_CUSTOM_DOMAIN=your-bolt-domain.com
set GRANICA_CUSTOM_DOMAIN=your-bolt-domain.com
set AWS_REGION=your-bolt-region
```

Expand Down

0 comments on commit c19ff28

Please sign in to comment.