Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose CLI Command Schema #12389

Open
1 task done
Mmarzex opened this issue Mar 15, 2024 · 2 comments
Open
1 task done

Compose CLI Command Schema #12389

Mmarzex opened this issue Mar 15, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@Mmarzex
Copy link
Contributor

Mmarzex commented Mar 15, 2024

Is there an existing issue for this?

  • I have searched existing issues, it hasn't been reported yet

Use case description

Framework currently follows a command format in the CLI where the action is the first action followed by an optional resource type and then whatever flags the command may require. However as new features such as Compose were added, we did not adhere to this standard and instead introduced further fragmentation where you would run Compose commands with different syntax.

In V4, we are going to keep the framework syntax as is, there will be no changes there. However we are going to revise the CLI command standards for Compose & Extensions.

We are going to introduce the following basic schema,

serverless <SERVICE/RESOURCE> <ACTION>

The goal is to have Compose and EXT adhere to this model going forward.

Examples

serverless-compose.yml

# Framework Service
service-a:
  path: ./service-a

# EXT Service
service-b:
  path: ./service-b

Framework Service serverless.yml

service: aws-node-express-api
frameworkVersion: '4'

provider:
  name: aws
  runtime: nodejs20.x

functions:
  api:
    handler: handler.handler
    events:
      - httpApi: '*'

Extension Service serverless.yml

my-extension:
  extension: my-extension@latest

my-extension-two:
  extension: my-extension@latest

So with these files we can then run commands in the following ways,

Run Deploy on a specific service in Compose

serverless service-a deploy

Run a command on a specific extension instance in Compose

serverless service-b my-extension deploy

Run Deploy function on a specific framework service in Compose

serverless service-a deploy function -f myApi

Proposed solution (optional)

No response

@Mmarzex Mmarzex added this to the v4-beta milestone Mar 15, 2024
@Mmarzex Mmarzex self-assigned this Mar 15, 2024
@ac360 ac360 added the V4 label Mar 15, 2024
@ac360
Copy link
Member

ac360 commented Mar 15, 2024

If we do want to be able to perform more granular commands in a Service from a Compose file, this seems like it fits nicely without changing the UX.

# In serverless.yml

serverless deploy function -f myApi
# In serverless-compose.yml

serverless service-a deploy function -f myApi

@Mmarzex
Copy link
Contributor Author

Mmarzex commented Mar 15, 2024

100% @ac360 I should have clarified better, but my intention was to not change how framework services work. So your examples are exactly what I intended. The examples currently are more for Extensions and Compose in general.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants