score-compose icon indicating copy to clipboard operation
score-compose copied to clipboard

[feature request] `supported_params` and `expected_outputs` for `cmd` provisioners

Open lekaf974 opened this issue 9 months ago • 6 comments

Currently when we are doing

score-compose init --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/score-k8s/10-redis-helm-upgrade.provisioners.yaml

the score-compose provisioners list don't display outputs because it is not supported

+-------+-------+--------+---------+-------------+
| TYPE  | CLASS | PARAMS | OUTPUTS | DESCRIPTION |
+-------+-------+--------+---------+-------------+
| redis |       |        |         |             |
+-------+-------+--------+---------+-------------+

Leaving this one to anyone who would like to take the opportunity to tackle a good first issue and help wanted issue. The goal is to back port what was done in score-k8s there: https://github.com/score-spec/score-k8s/pull/156, in this repo here.

lekaf974 avatar Mar 18 '25 22:03 lekaf974

@mathieu-benoit started to work on it

lekaf974 avatar Mar 18 '25 22:03 lekaf974

@astromechza @mathieu-benoit need some insight here

I tested this locally based on main without any changes

start a init

go run cmd/score-compose/main.go init --provisioners https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/score-compose/10-redis-dapr-pubsub.provisioners.yaml

then

go run cmd/score-compose/main.go provisioners list

+---------------+---------+------------------+--------------------------------+--------------------------------+
|     TYPE      |  CLASS  |      PARAMS      |            OUTPUTS             |          DESCRIPTION           |
+---------------+---------+------------------+--------------------------------+--------------------------------+
...
+---------------+---------+------------------+--------------------------------+--------------------------------+
| dapr-pubsub   | default |                  | name                           | Generates a Redis Service      |
|               |         |                  |                                | and a Dapr PubSub Component    |
|               |         |                  |                                | pointing to this Redis         |
|               |         |                  |                                | Service.                       |
+---------------+---------+------------------+--------------------------------+--------------------------------+
......

in the file shared in slack https://raw.githubusercontent.com/score-spec/community-provisioners/refs/heads/main/score-k8s/10-redis-helm-upgrade.provisioners.yaml there is only one row to help determine what are the expected outputs

OUTPUTS='{"resource_outputs":{"host":"%s-master", "port":"6379", "username":"", "password":"🔐💬%s_redis-password💬🔐"},"manifests":[]}'

what would be the best approach to have expected_outputs ?

lekaf974 avatar Mar 18 '25 23:03 lekaf974

Yup, exactly, what about adding the expected_outputs in the cmd like we have with the template, like this below?

- uri: template://...
  description: ...
  type: ....
  class: ...
  init:...
  state: ...
  outputs:...
  expected_outputs:...
- uri: cmd://...
  type:...
  args:...
  expected_outputs:...

mathieu-benoit avatar Mar 19 '25 00:03 mathieu-benoit

Hey @lekaf974, have you started anything here? If not, I would love to see if someone during the ContribFest at KubeCon this week would be able to take this one. Do you mind? If nobody, I'll reassign to you after this week?

mathieu-benoit avatar Mar 29 '25 12:03 mathieu-benoit

Not yet, feel free to assigned to someone else. Busy on my end currently

lekaf974 avatar Mar 29 '25 14:03 lekaf974

Leaving this one to anyone who would like to take the opportunity to tackle a good first issue and help wanted issue. The goal is to back port what was done in score-k8s there: https://github.com/score-spec/score-k8s/pull/156, in this repo here.

mathieu-benoit avatar Apr 17 '25 22:04 mathieu-benoit

Hi, I'd like to take up this issue

mageshwaransekar avatar May 19 '25 23:05 mageshwaransekar

Sure thing, @mageshwaransekar, thanks for raising your hand on this one!

Please do let us know if you have any questions. This should provide you already great guidance:

The goal is to back port what was done in score-k8s there: https://github.com/score-spec/score-k8s/pull/156, in this repo here.

mathieu-benoit avatar May 20 '25 00:05 mathieu-benoit

Hi @mageshwaransekar, is there anything we can help you with to get started on this? Just making sure you have all the information needed ;)

Note: this will allow to support this https://github.com/score-spec/community-provisioners/blob/main/dns/score-compose/10-dns-in-codespace.provisioners.yaml#L13-L15.

mathieu-benoit avatar May 31 '25 12:05 mathieu-benoit

Hi @mathieu-benoit, I'll start working on it this week as I was busy last week

mageshwaransekar avatar Jun 02 '25 13:06 mageshwaransekar

Hi @mageshwaransekar, just checking that you have all the information needed to start working on this? If it's not a good timing for you to contribute to this one, no worries, we can assign it to someone else and find you another one when you'll be ready. Thanks!

mathieu-benoit avatar Jul 01 '25 19:07 mathieu-benoit

Now opening to anyone who would like to pick up this one.

The goal is to back port what was done in score-k8s there: https://github.com/score-spec/score-k8s/pull/156, in this repo here. Note: this will allow to support this https://github.com/score-spec/community-provisioners/blob/main/dns/score-compose/10-dns-in-codespace.provisioners.yaml#L13-L15.

mathieu-benoit avatar Jul 07 '25 22:07 mathieu-benoit

@mathieu-benoit got some times to work on this, already started

lekaf974 avatar Jul 14 '25 14:07 lekaf974