Skip to content

Commit

Permalink
Merge pull request #6 from mayur-tolexo/rename-to-sample-storage
Browse files Browse the repository at this point in the history
renamed the sample storage layer to sample storage
  • Loading branch information
Iceber committed Jan 16, 2024
2 parents 955c326 + 8589ec2 commit afc6848
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
# Sample Storage Layer
The storage layer plugin example replicates the implementation of the [internal storage layer](https://github.com/clusterpedia-io/clusterpedia/tree/main/pkg/storage/internalstorage), but it has the storage layer name - **sample storage layer**.
# Sample Storage
The storage layer plugin example replicates the implementation of the [internal storage layer](https://github.com/clusterpedia-io/clusterpedia/tree/main/pkg/storage/internalstorage), but it has the storage layer name - **sample storage**.

And you can see the storage layer information from the log when you list the resources.
```bash
$ STORAGE_PLUGINS=./plugins ./bin/apiserver --storage-name=sample-storage-layer --storage-config=./config.yaml <... other flags>
$ STORAGE_PLUGINS=./plugins ./bin/apiserver --storage-name=sample-storage --storage-config=./config.yaml <... other flags>
...

I1107 11:35:14.450738 18955 resource_storage.go:195] "list resources in the sample storage layer" gvr="pods"
I1107 11:35:14.450738 18955 resource_storage.go:195] "list resources in the sample storage" gvr="pods"
I1107 11:35:14.483075 18955 httplog.go:131] "HTTP" verb="GET" URI="/apis/clusterpedia.io/v1beta1/resources/api/v1/pods?limit=1" latency="40.270678ms" userAgent="curl/7.64.1" audit-ID="4ed69024-1848-4aa1-9f72-a9f1d7f36e3f" srcIP="127.0.0.1:58568" resp=200
```
`curl -k --cert client.crt --key client.key https://127.0.0.1:8443/apis/clusterpedia.io/v1beta1/resources/api/v1/pods\?limit\=1`

## Build and Run
`git clone` repo
```bash
$ git clone --recursive https://github.com/clusterpedia-io/sample-storage-layer.git
$ cd sample-storage-layer
$ git clone --recursive https://github.com/clusterpedia-io/sample-storage.git
$ cd sample-storage
```

build storage layer plugin
```bash
$ make build-plugin

$ # check plugin
$ file ./plugins/sample-storage-layer.so
./plugins/sample-storage-layer.so: Mach-O 64-bit dynamically linked shared library x86_64
$ file ./plugins/sample-storage.so
./plugins/sample-storage.so: Mach-O 64-bit dynamically linked shared library x86_64
```

build clusterpedia components for the debug
Expand All @@ -41,10 +41,10 @@ drwxr-xr-x 16 icebergu staff 512 11 7 11:15 ..

run clusterpedia apiserver
```bash
$ STORAGE_PLUGINS=./plugins ./bin/apiserver --storage-name=sample-storage-layer --storage-config=./config.yaml <... other flags>
$ STORAGE_PLUGINS=./plugins ./bin/apiserver --storage-name=sample-storage --storage-config=./config.yaml <... other flags>
```

run clusterpedia clustersynchro-manager
```bash
$ STORAGE_PLUGINS=./plugins ./bin/clustersynchro-manager --storage-name=sample-storage-layer --storage-config=./config.yaml <... other flags>
$ STORAGE_PLUGINS=./plugins ./bin/clustersynchro-manager --storage-name=sample-storage --storage-config=./config.yaml <... other flags>
```
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/clusterpedia-io/sample-storage-layer
module github.com/clusterpedia-io/sample-storage

go 1.19

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
plugin "github.com/clusterpedia-io/sample-storage-layer/storage"
plugin "github.com/clusterpedia-io/sample-storage/storage"
)

func init() {
Expand Down
4 changes: 2 additions & 2 deletions storage/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
)

const (
StorageName = "sample-storage-layer"
StorageName = "sample-storage"

defaultLogFileName = "/var/log/clusterpedia/sample-storage-layer.log"
defaultLogFileName = "/var/log/clusterpedia/sample-storage.log"
)

func RegisterStorageLayer() {
Expand Down

0 comments on commit afc6848

Please sign in to comment.