Skip to content

Commit

Permalink
Add start-stop scripts for soda-proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
asifdxtreme committed May 7, 2021
1 parent 5d7783a commit e456ac0
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 3 deletions.
11 changes: 8 additions & 3 deletions csi-plug-n-play/sidecars/soda-proxy/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ go get github.com/sodafoundation/nbp

cd $GOPATH/src/github.com/sodafoundation/nbp/csi-plug-n-play/sidecars/soda-proxy

go build cmd/proxy.go
go build -o soda-proxy cmd/proxy.go
```

Before running soda-proxy you need to export the below variables.(These are the same env variables which are required by osdsctl, for more reference you can see [this](https://docs.sodafoundation.io/soda-gettingstarted/installation-using-ansible/#how-to-test-soda-projects-cluster))
Before running soda-proxy you need to update the below variables in `scripts/start.sh`.(These are the same env variables which are required by osdsctl, for more reference you can see [this](https://docs.sodafoundation.io/soda-gettingstarted/installation-using-ansible/#how-to-test-soda-projects-cluster))

```go

Expand All @@ -28,8 +28,13 @@ export OS_USER_DOMAIN_ID=default
```

```go
./proxy
./scripts/start.sh

```

By default soda-proxy runs on `0.0.0.0:50029`

Cleanup
```go
./scripts/stop.sh
```
26 changes: 26 additions & 0 deletions csi-plug-n-play/sidecars/soda-proxy/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2021 The SodaFoundation Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -e

export OPENSDS_ENDPOINT=http://{your_real_host_ip}:50040
export OPENSDS_AUTH_STRATEGY=keystone
export OS_AUTH_URL=http://{your_real_host_ip}/identity
export OS_USERNAME=admin
export OS_PASSWORD=opensds@123
export OS_TENANT_NAME=admin
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_ID=default

./soda-proxy > start-proxy.log 2>&1 &
15 changes: 15 additions & 0 deletions csi-plug-n-play/sidecars/soda-proxy/scripts/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2021 The SodaFoundation Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

kill -9 $(ps aux | grep 'soda-proxy' | awk '{print $2}')

0 comments on commit e456ac0

Please sign in to comment.