Skip to content

Commit

Permalink
refactor: change resource name 'nodes' to 'specs'
Browse files Browse the repository at this point in the history
  • Loading branch information
siyul-park committed Nov 22, 2024
1 parent 611a884 commit 7393059
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 88 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Adjust settings through `.uniflow.toml` or environment variables.
|----------------------|--------------------------|---------------------------|
| `database.url` | `DATABASE.URL` | `mem://` or `mongodb://` |
| `database.name` | `DATABASE.NAME` | - |
| `collection.nodes` | `COLLECTION.NODES` | `nodes` |
| `collection.specs` | `COLLECTION.SPECS` | `nodes` |
| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` |

## 📊 Benchmark
Expand Down
2 changes: 1 addition & 1 deletion README_kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pong#
|----------------------|--------------------------|---------------------------|
| `database.url` | `DATABASE.URL` | `mem://` 또는 `mongodb://` |
| `database.name` | `DATABASE.NAME` | - |
| `collection.nodes` | `COLLECTION.NODES` | `nodes` |
| `collection.specs` | `COLLECTION.SPECS` | `nodes` |
| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` |

## 📊 벤치마크
Expand Down
8 changes: 4 additions & 4 deletions cmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Settings can be modified using the `.uniflow.toml` file or system environment va
| `database.url` | `DATABASE.URL` | `mem://` or `mongodb://` |
| `database.name` | `DATABASE.NAME` | - |
| `collection.charts` | `COLLECTION.CHARTS` | `charts` |
| `collection.nodes` | `COLLECTION.NODES` | `nodes` |
| `collection.specs` | `COLLECTION.SPECS` | `nodes` |
| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` |

If you are using [MongoDB](https://www.mongodb.com/), enable [Change Streams](https://www.mongodb.com/docs/manual/changeStreams/) to track resource changes in real time. This requires setting up a [replica set](https://www.mongodb.com/docs/manual/replication/).
Expand All @@ -31,7 +31,7 @@ The `start` command executes all node specifications in the specified namespace.
If the namespace is empty, you can provide an initial node specification using the `--from-specs` flag:

```sh
./dist/uniflow start --namespace default --from-specs examples/nodes.yaml
./dist/uniflow start --namespace default --from-specs examples/specs.yaml
```

You can specify an initial secrets file with the `--from-secrets` flag:
Expand All @@ -55,7 +55,7 @@ Charts can be initialized using the `--from-charts` flag:
The `apply` command applies the contents of a specified file to the namespace. If no namespace is specified, the `default` namespace is used.

```sh
./dist/uniflowctl apply nodes --namespace default --filename examples/nodes.yaml
./dist/uniflowctl apply nodes --namespace default --filename examples/specs.yaml
```

To apply secrets:
Expand All @@ -75,7 +75,7 @@ To apply charts:
The `delete` command removes all resources defined in the specified file. If no namespace is specified, the `default` namespace is used.

```sh
./dist/uniflowctl delete nodes --namespace default --filename examples/nodes.yaml
./dist/uniflowctl delete nodes --namespace default --filename examples/specs.yaml
```

To delete secrets:
Expand Down
8 changes: 4 additions & 4 deletions cmd/README_kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| `database.url` | `DATABASE.URL` | `mem://` 또는 `mongodb://` |
| `database.name` | `DATABASE.NAME` | - |
| `collection.charts` | `COLLECTION.CHARTS` | `charts` |
| `collection.nodes` | `COLLECTION.NODES` | `nodes` |
| `collection.specs` | `COLLECTION.SPECS` | `nodes` |
| `collection.secrets` | `COLLECTION.SECRETS` | `secrets` |

만약 [MongoDB](https://www.mongodb.com/)를 사용한다면, 리소스의 변경 사항을 실시간으로 추적하기 위해 [변경 스트림](https://www.mongodb.com/docs/manual/changeStreams/)을 활성화해야 합니다. 이를 위해서는 [복제 세트](https://www.mongodb.com/docs/manual/replication/) 설정이 필요합니다.
Expand All @@ -31,7 +31,7 @@
네임스페이스가 비어 있을 경우, 초기 노드 명세를 `--from-specs` 플래그로 제공할 수 있습니다:

```sh
./dist/uniflow start --namespace default --from-specs examples/nodes.yaml
./dist/uniflow start --namespace default --from-specs examples/specs.yaml
```

초기 시크릿 파일은 `--from-secrets` 플래그로 설정할 수 있습니다:
Expand All @@ -54,7 +54,7 @@
`apply` 명령어는 지정된 파일 내용을 네임스페이스에 적용합니다. 네임스페이스를 지정하지 않으면 기본적으로 `default` 네임스페이스가 사용됩니다.

```sh
./dist/uniflowctl apply nodes --namespace default --filename examples/nodes.yaml
./dist/uniflowctl apply nodes --namespace default --filename examples/specs.yaml
```

시크릿을 적용하려면:
Expand All @@ -74,7 +74,7 @@
`delete` 명령어는 지정된 파일에 정의된 모든 리소스를 삭제합니다. 네임스페이스를 지정하지 않으면 기본적으로 `default` 네임스페이스가 사용됩니다.

```sh
./dist/uniflowctl delete nodes --namespace default --filename examples/nodes.yaml
./dist/uniflowctl delete nodes --namespace default --filename examples/specs.yaml
```

시크릿을 삭제하려면:
Expand Down
22 changes: 11 additions & 11 deletions cmd/pkg/uniflow/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const configFile = ".uniflow.toml"
const (
flagDatabaseURL = "database.url"
flagDatabaseName = "database.name"
flagCollectionNodes = "collection.nodes"
flagCollectionSpecs = "collection.specs"
flagCollectionSecrets = "collection.secrets"
flagCollectionCharts = "collection.charts"
)
Expand All @@ -41,10 +41,10 @@ const (
opUpdateCharts = "charts.update"
opDeleteCharts = "charts.delete"

opCreateNodes = "nodes.create"
opReadNodes = "nodes.read"
opUpdateNodes = "nodes.update"
opDeleteNodes = "nodes.delete"
opCreateSpecs = "specs.create"
opReadSpecs = "specs.read"
opUpdateSpecs = "specs.update"
opDeleteSpecs = "specs.delete"

opCreateSecrets = "secrets.create"
opReadSecrets = "secrets.read"
Expand All @@ -53,7 +53,7 @@ const (
)

func init() {
viper.SetDefault(flagCollectionNodes, "nodes")
viper.SetDefault(flagCollectionSpecs, "specs")
viper.SetDefault(flagCollectionSecrets, "secrets")
viper.SetDefault(flagCollectionCharts, "charts")

Expand All @@ -67,7 +67,7 @@ func main() {

databaseURL := viper.GetString(flagDatabaseURL)
databaseName := viper.GetString(flagDatabaseName)
collectionNodes := viper.GetString(flagCollectionNodes)
collectionNodes := viper.GetString(flagCollectionSpecs)
collectionSecrets := viper.GetString(flagCollectionSecrets)
collectionCharts := viper.GetString(flagCollectionCharts)

Expand Down Expand Up @@ -106,10 +106,10 @@ func main() {
langs.Store(typescript.Language, typescript.NewCompiler())

nativeTable := system.NewNativeTable()
nativeTable.Store(opCreateNodes, system.CreateResource(specStore))
nativeTable.Store(opReadNodes, system.ReadResource(specStore))
nativeTable.Store(opUpdateNodes, system.UpdateResource(specStore))
nativeTable.Store(opDeleteNodes, system.DeleteResource(specStore))
nativeTable.Store(opCreateSpecs, system.CreateResource(specStore))
nativeTable.Store(opReadSpecs, system.ReadResource(specStore))
nativeTable.Store(opUpdateSpecs, system.UpdateResource(specStore))
nativeTable.Store(opDeleteSpecs, system.DeleteResource(specStore))
nativeTable.Store(opCreateSecrets, system.CreateResource(secretStore))
nativeTable.Store(opReadSecrets, system.ReadResource(secretStore))
nativeTable.Store(opUpdateSecrets, system.UpdateResource(secretStore))
Expand Down
6 changes: 3 additions & 3 deletions cmd/pkg/uniflowctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ const configFile = ".uniflow.toml"
const (
flagDatabaseURL = "database.url"
flagDatabaseName = "database.name"
flagCollectionNodes = "collection.nodes"
flagCollectionSpecs = "collection.specs"
flagCollectionSecrets = "collection.secrets"
flagCollectionCharts = "collection.charts"
)

func init() {
viper.SetDefault(flagCollectionNodes, "nodes")
viper.SetDefault(flagCollectionSpecs, "specs")
viper.SetDefault(flagCollectionSecrets, "secrets")
viper.SetDefault(flagCollectionCharts, "charts")

Expand All @@ -37,7 +37,7 @@ func main() {

databaseURL := viper.GetString(flagDatabaseURL)
databaseName := viper.GetString(flagDatabaseName)
collectionNodes := viper.GetString(flagCollectionNodes)
collectionNodes := viper.GetString(flagCollectionSpecs)
collectionSecrets := viper.GetString(flagCollectionSecrets)
collectionCharts := viper.GetString(flagCollectionCharts)

Expand Down
32 changes: 16 additions & 16 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,39 +51,39 @@ Users can update node specifications by using a Command-Line Interface (CLI) or
name: router
routes:
- method: POST
path: /v1/nodes
path: /v1/specs
port: out[0]
- method: GET
path: /v1/nodes
path: /v1/specs
port: out[1]
- method: PATCH
path: /v1/nodes
path: /v1/specs
port: out[2]
- method: DELETE
path: /v1/nodes
path: /v1/specs
port: out[3]
ports:
out[0]:
- name: nodes_create
- name: specs_create
port: in
out[1]:
- name: nodes_read
- name: specs_read
port: in
out[2]:
- name: nodes_update
- name: specs_update
port: in
out[3]:
- name: nodes_delete
- name: specs_delete
port: in

- kind: block
name: nodes_create
name: specs_create
specs:
- kind: snippet
language: cel
code: 'has(self.body) ? self.body : null'
- kind: native
opcode: nodes.create
opcode: specs.create
- kind: snippet
language: javascript
code: |
Expand All @@ -95,13 +95,13 @@ Users can update node specifications by using a Command-Line Interface (CLI) or
}
- kind: block
name: nodes_read
name: specs_read
specs:
- kind: snippet
language: json
code: 'null'
- kind: native
opcode: nodes.read
opcode: specs.read
- kind: snippet
language: javascript
code: |
Expand All @@ -113,13 +113,13 @@ Users can update node specifications by using a Command-Line Interface (CLI) or
}
- kind: block
name: nodes_update
name: specs_update
specs:
- kind: snippet
language: cel
code: 'has(self.body) ? self.body : null'
- kind: native
opcode: nodes.update
opcode: specs.update
- kind: snippet
language: javascript
code: |
Expand All @@ -131,13 +131,13 @@ Users can update node specifications by using a Command-Line Interface (CLI) or
}
- kind: block
name: nodes_delete
name: specs_delete
specs:
- kind: snippet
language: json
code: 'null'
- kind: native
opcode: nodes.delete
opcode: specs.delete
- kind: snippet
language: javascript
code: |
Expand Down
32 changes: 16 additions & 16 deletions docs/architecture_kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,39 +49,39 @@
name: router
routes:
- method: POST
path: /v1/nodes
path: /v1/specs
port: out[0]
- method: GET
path: /v1/nodes
path: /v1/specs
port: out[1]
- method: PATCH
path: /v1/nodes
path: /v1/specs
port: out[2]
- method: DELETE
path: /v1/nodes
path: /v1/specs
port: out[3]
ports:
out[0]:
- name: nodes_create
- name: specs_create
port: in
out[1]:
- name: nodes_read
- name: specs_read
port: in
out[2]:
- name: nodes_update
- name: specs_update
port: in
out[3]:
- name: nodes_delete
- name: specs_delete
port: in

- kind: block
name: nodes_create
name: specs_create
specs:
- kind: snippet
language: cel
code: 'has(self.body) ? self.body : null'
- kind: native
opcode: nodes.create
opcode: specs.create
- kind: snippet
language: javascript
code: |
Expand All @@ -93,13 +93,13 @@
}
- kind: block
name: nodes_read
name: specs_read
specs:
- kind: snippet
language: json
code: 'null'
- kind: native
opcode: nodes.read
opcode: specs.read
- kind: snippet
language: javascript
code: |
Expand All @@ -111,13 +111,13 @@
}
- kind: block
name: nodes_update
name: specs_update
specs:
- kind: snippet
language: cel
code: 'has(self.body) ? self.body : null'
- kind: native
opcode: nodes.update
opcode: specs.update
- kind: snippet
language: javascript
code: |
Expand All @@ -129,13 +129,13 @@
}
- kind: block
name: nodes_delete
name: specs_delete
specs:
- kind: snippet
language: json
code: 'null'
- kind: native
opcode: nodes.delete
opcode: specs.delete
- kind: snippet
language: javascript
code: |
Expand Down
Loading

0 comments on commit 7393059

Please sign in to comment.