Commit Graph

98 Commits

Author SHA1 Message Date
twinguy c939814420
Use compatibleflags approach instead of incompatible
Signed-off-by: twinguy <twinguy17@gmail.com>
2025-04-11 21:43:37 -05:00
twinguy e7c1a322d7
Refactor warning message for incompatible flags in --run-file
Signed-off-by: twinguy <twinguy17@gmail.com>
2025-03-24 16:32:13 -05:00
twinguy ce0b9fb4d9
Add detection for incompatible flags with --run-file
Signed-off-by: twinguy <twinguy17@gmail.com>
2025-03-23 23:39:44 -05:00
Anton Troshin a0921c7820
Fix scheduler address for dapr run with file on Windows (#1497)
Signed-off-by: Anton Troshin <anton@diagrid.io>
2025-03-05 17:18:23 -08:00
Mike Nguyen 0cd0585b64
fix: arguments accept units (#1490)
* fix: arguments accept units
`max-body-size` and `read-buffer-size` now accept units as defined in the docs.

Fixes #1489

Signed-off-by: Mike Nguyen <hey@mike.ee>

* chore: gofumpt

Signed-off-by: Mike Nguyen <hey@mike.ee>

* refactor: modify logic to comply with vetting

Signed-off-by: Mike Nguyen <hey@mike.ee>

* chore: gofumpt -w .

Signed-off-by: Mike Nguyen <hey@mike.ee>

* refactor: set defaults
`max-body-size` is defaulted to 4Mi
`request-buffer-size` is defaulted to 4Ki

This is inline with the runtime.

Signed-off-by: Mike Nguyen <hey@mike.ee>

* fix: set defaults in run and annotate

Signed-off-by: Mike Nguyen <hey@mike.ee>

* chore: gofumpt

Signed-off-by: Mike Nguyen <hey@mike.ee>

* refactor: exit with error rather than panic

Co-authored-by: Anton Troshin <troll.sic@gmail.com>
Signed-off-by: Mike Nguyen <hey@mike.ee>

---------

Signed-off-by: Mike Nguyen <hey@mike.ee>
Co-authored-by: Anton Troshin <troll.sic@gmail.com>
2025-02-21 08:11:11 -08:00
Yaron Schneider ac6822ea69
Remove deprecated flags (#1482)
* remove deprecated flags

Signed-off-by: yaron2 <schneider.yaron@live.com>

* update Dapr version in tests

Signed-off-by: yaron2 <schneider.yaron@live.com>

---------

Signed-off-by: yaron2 <schneider.yaron@live.com>
2025-02-03 13:27:22 -08:00
Mike Nguyen 3acfa7d7e4
fix: population of the schedulerhostaddress in self-hosted mode (#1475)
* fix: population of the schedulerhostaddress in self-hosted mode

The scheduler host address is pre-populated when using the self-hosted mode multi-app run similarly to the single app run.
Kubernetes multi-app run is not affected and you will still need to specify a scheduler host address.

Signed-off-by: mikeee <hey@mike.ee>

* chore: lint

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2025-01-20 14:18:31 -08:00
Anton Troshin 17f4785906
Update dependencies, Go version and address CVEs (#1474)
* Update dependencies, Go version and address CVEs

Signed-off-by: Anton Troshin <anton@diagrid.io>

* update golangci-lint version and list of disabled linters form dapr/dapr

Signed-off-by: Anton Troshin <anton@diagrid.io>

* adjust golangci-lint settings and fix lint issues

Signed-off-by: Anton Troshin <anton@diagrid.io>

* fix test

Signed-off-by: Anton Troshin <anton@diagrid.io>

---------

Signed-off-by: Anton Troshin <anton@diagrid.io>
2025-01-09 14:16:44 -08:00
Mike Nguyen dbbe022a8a
fix: allow the scheduler client to initialise for edge builds (#1467)
Signed-off-by: mikeee <hey@mike.ee>
2024-11-26 13:09:01 -08:00
Mike Nguyen ed0d3af2d0
fix: scheduler host address passed to runtime (#1421)
* fix: scheduler host address passed to runtime

Signed-off-by: mikeee <hey@mike.ee>

* fix: scheduler client stream initialised for 1.14<

Signed-off-by: mikeee <hey@mike.ee>

* fix: modify scheduler host address validation

if the scheduler container is not active, the scheduler flag will
not be passed to the runtime

Signed-off-by: mikeee <hey@mike.ee>

* fix: lint and refactor

Signed-off-by: mikeee <hey@mike.ee>

---------

Signed-off-by: mikeee <hey@mike.ee>
2024-07-10 09:37:34 -07:00
Cassie Coyle fd1d8e85bf
Distributed Scheduler CLI Changes (#1405)
* wip

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* rm scheduleJob logic. keep only init/uninstall logic

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>

* Fixes install and uninstall of scheduler in standalone mode.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fixing path for Go tools in Darwin.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix Go bin location for MacOS.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix min scheduler version to be 1.14.x

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Use env var to pass scheduler host.

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

* Fix CLI build to work with latest MacOS runners from GH

Signed-off-by: Artur Souza <asouza.pro@gmail.com>

---------

Signed-off-by: Cassandra Coyle <cassie@diagrid.io>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Co-authored-by: Artur Souza <asouza.pro@gmail.com>
2024-07-03 14:58:55 -07:00
Stuart Leeks 668bab451d
Add --run-file support for stdin (#1364)
If the run-file argument is speficied as '-', read the config file from stdin

Signed-off-by: Stuart Leeks <stuartle@microsoft.com>
2023-11-22 07:04:02 -08:00
Pravin Pushkar 504d4eadba
Removing preview feature for dapr run -f (#1348)
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
2023-09-27 09:03:24 -07:00
Mukundan Sundararajan a15a3eb856
Initial implementation of multi app run for Kubernetes Dev (#1333)
* initial commit for multi-app run k8s impl

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix import

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* move runfileconfig

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add protobuf conflict warn env

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* Add pubsub component. Check before component creation.

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix e2e

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix e2e

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix e2e

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* address review comments.

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

---------

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-09-04 08:42:58 +05:30
Pravin Pushkar 6738eefe2b
Multiapp run and stop implementation for windows (#1315)
* windows impl for multiapp run

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Uncommenting run on windows

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix static checks

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Kill children and grand children forcefully

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* ommiting tests for wiondows

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* rename method

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* shut down all processes

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Use job handle and named evens together to kill the processes

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* lint fix

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* revert wait to kill

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Adding E2E for windows template file run

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* rename job name

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* build failure

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

---------

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-08-30 11:06:40 +05:30
Shivam Kumar Singh 7da8bd7b15
shivam-51: Add log file paths to dapr list 1228 (#1296)
* shivam-51: Add log file paths to dapr list 1228

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Minor type fix.

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Add condition for log file in dapr list

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Add tests

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Complete tests

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Fix failing e2e tests

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Use constants

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Add success tests

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Add proper assert in test

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

* Fix typo

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>

---------

Signed-off-by: Shivam Kumar Singh <shivamhere247@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-06-13 18:34:03 +05:30
Mukundan Sundararajan c3f08b0679
add app channel address flag for run (#1283)
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-05-31 05:21:02 -07:00
Pravin Pushkar c65d816612
Move logdestination flag to sharedRunConfig (#1294)
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
2023-05-30 21:00:34 -07:00
Pravin Pushkar af9030a383
Change for multiple resources paths (#1276)
* Initial change for multiple resources paths for normal run

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* multi app run changes for multiple resource paths

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* correct file paths for windows

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* remove checking duplicates

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* addressed review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Fix tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

---------

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
2023-05-25 07:54:20 -07:00
Mukundan Sundararajan d3f54cf94b
Add name template (#1274)
* add ability to specify a name for a run template

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix test template

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* move list e2e tests to stop template subtest

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix template name

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* Update cmd/run.go

Co-authored-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

---------

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Pravin Pushkar <ppushkar@microsoft.com>
2023-04-25 15:40:22 +05:30
Pravin Pushkar 9f67738e24
fix appID reference (#1273)
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-04-24 12:14:49 +05:30
Pravin Pushkar 7abf871ce0
Configurable log destination (#1258)
* COnfigurable log destination

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Custom writer impl

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix e2e tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix flaky mar tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* adding e2e for log destination

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* adding tests and change logic to create log file

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* update e2e tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

---------

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-04-24 11:30:46 +05:30
Mukundan Sundararajan 4e3ae81df5
deprecate app-ssl flag in cli (#1269)
* deprecate app-ssl flag in cli

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* Update cmd/annotate.go

Co-authored-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

---------

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Shubham Sharma <shubhash@microsoft.com>
2023-04-12 21:02:10 -07:00
Mukundan Sundararajan a7f06c3b1b
Fix runtime custom path installation logic (#1203)
* fix dapr path version, custom  installation path logic, e2e

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix linter errors

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix paths for windows

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* rename daprPath to daprRuntimePath

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

---------

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-02-05 21:57:23 -08:00
Phillip Hoff 50d5af4cd9
Store app PID in sidecar metadata. (#1200)
* Store app PID in sidecar metadata.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

* Move process check under command check.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

* Add minimal list test appId changes.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

* Reverse params.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

* Proper type conversion.

Signed-off-by: Phillip Hoff <phillip@orst.edu>

---------

Signed-off-by: Phillip Hoff <phillip@orst.edu>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-02-02 11:45:23 +05:30
Shubham Sharma 42f9519eb2
Add preview warning to dapr run and add appID and timestamp to logs (#1196)
* Add timestamp to logs and preview warning

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix test

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update log format

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update log format

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Update comment

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

---------

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
2023-02-01 16:19:48 +05:30
Pravin Pushkar 778b2a5933
dapr stop -f fix and E2E tests for dapr stop and list (#1181)
* E2E tests for dapr stop and list

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* cmdstop to cmdStopWithAppID

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* stop all started processes for dapr apps with kill process group

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* stop all apps in run template test

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* separating os syscall and renaming file

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* moving syscall.go to pkg/syscall

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* name change

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fixed windows error

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* use syscall.kill

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

---------

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-01-31 13:07:42 +05:30
Mukundan Sundararajan 17dbe5bb13
Add E2E for Run template (#1170)
* refactor run into functions

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* renamed Apps struct as App

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* redirect logs to files. set informational logs. set command dirs

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix linter errors

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix e2e test on non-existent resources-path

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* more fixes

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix merge conflict

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* set default ports for zero values

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix linter errors

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add more details in error, fix logs in run -f

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* address review comments

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* address review comments

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add more fixes in template run based on e2e tests

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add basic happy path e2e for dapr run -f

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add positive and negative e2e tests for run template

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* address review comments

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-01-24 10:58:05 -08:00
Pravin Pushkar 14c04f9a87
Dapr stop and list changes for dapr run -f (#1169)
* dapr stop -f impl

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* add description

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix windows failure

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Update cmd/stop.go

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* change cmd description

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* stop refactoring

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* trigger pr checks

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-01-24 18:28:31 +05:30
Mukundan Sundararajan 36893d9483
Add capability to run to support `-f` flag (#1161)
* refactor run into functions

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* renamed Apps struct as App

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* redirect logs to files. set informational logs. set command dirs

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix linter errors

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix e2e test on non-existent resources-path

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* more fixes

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix merge conflict

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* set default ports for zero values

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix linter errors

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add more details in error, fix logs in run -f

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* address review comments

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* address review comments

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* add more fixes in template run based on e2e tests

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-01-20 08:17:34 -08:00
Pravin Pushkar 9d18f86768
find dapr.yaml in dirpath when dapr run -f <dirpath> is executed (#1166)
* find dapr.yaml in dirpath when dapr run -f <dirpath> is executed

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* modtidy

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* get rid of afero

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* merge fixes

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-01-19 10:06:01 -08:00
Pravin Pushkar 44d8dcb752
Precedence rule for resources directory, config file and envs (#1158)
* precedence order for resources path and config path

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* env precedence set

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* pass daprInstallPath

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* test dir structure

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* remove hard coded directory structures

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* UT refactor

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* few fixes w.r.t daprPathCmdFlag

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* switching to pre-created test data folder structure

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Move Env to SharedRunConfig struct

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix bug

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* lint fix

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* some refactoring

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-01-19 22:10:16 +05:30
Pravin Pushkar c1f9627ed6
Apps run config template parsing (#1152)
* initial commit for run template parsing

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* some code refactor.

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* add some UTs

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* call validate

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* add tests and correct err message

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* refactor Runconfig into 2 structs

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Fix Arg parsing

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix UTs. make app-id be inferred from app-dir if empty

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* put config reltd code into separate folder

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* merge logic for common and apps section of flags.

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* adding tests and few refactoring

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* file close

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* refactor file names

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* resolve path to abs and add more e2e for path resolving

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* address review comments

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* remove getAppskeysmapping

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* add tests, and fix issue for setitng app id when empty.

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2023-01-03 17:19:59 +05:30
mikeb26 53dff409b4
Support environments with broken $HOME (#1057)
* Support environments with broken $HOME

Currently in standalone mode dapr cli will install the dapr runtime
binaries into $HOME/.dapr. However, in some environments $HOME is
readonly or os.UserHomeDir() can fail (e.g. AWS Lambda). To support
dapr in these environments this change does 2 things:

1. Allows the user to set DAPR_PATH environment variable to indicate
the location of the dapr runtime binaries.

2. Allows the user to optionally specify --dapr-path cli flag to
indicate the location of the dapr runtime binaries. When both
DAPR_PATH environment variable and --dapr-path CLI flag are present,
the cli flag has higher precedence.

When neither DAPR_PATH nor the --dapr-path CLI flag are present, we
fallback to existing behavior of defaulting to $HOME/.dapr.

Signed-off-by: Mike Brown <github@torvosoft.com>

* Address comments

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Address comments

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Address comments

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix unit test

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix e2e test

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix lint

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Signed-off-by: Mike Brown <github@torvosoft.com>
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Co-authored-by: Shubham Sharma <shubhash@microsoft.com>
2023-01-03 15:40:06 +05:30
Huei Feng 6c1bc5357c
support resources-path (#1012)
* support spec-resources-path

Signed-off-by: HueiFeng <695979933@qq.com>

* Update resource-path

Signed-off-by: hueifeng <695979933@qq.com>

* Update resource-path

Signed-off-by: hueifeng <695979933@qq.com>

* fix

Signed-off-by: hueifeng <695979933@qq.com>

* added deprecation message and e2e tests

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* added messages in readme for deprecation and use of resource-path

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* fix lint and failing test case

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Signed-off-by: HueiFeng <695979933@qq.com>
Signed-off-by: hueifeng <695979933@qq.com>
Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Shubham Sharma <shubhash@microsoft.com>
Co-authored-by: Pravin Pushkar <ppushkar@microsoft.com>
2022-12-08 01:21:13 -08:00
Albert 13eed0eaf3
Support -dapr-listen-address option to daprd (#1129) 2022-11-18 20:49:31 +05:30
Shubham Sharma 8d79ef13ec
Nit: appHealthEnabled => enableAppHealth (#1087)
Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-10-09 23:21:34 -07:00
Alessandro (Ale) Segala 657310541a
Add flags for app health checks (#1083)
* Add flags for app health checks

Fixes #1082

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Added tests

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* 💄

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Update pkg/standalone/run_test.go

Co-authored-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>

* Update pkg/standalone/run_test.go

Co-authored-by: Shubham Sharma <shubhash@microsoft.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>

* fix go version to 1.19.2

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
Co-authored-by: Shubham Sharma <shubhash@microsoft.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-10-09 21:59:18 -07:00
Shubham Sharma f7e2b5f7ef
Make internal-grpc-port option configurable (#1040)
* Added internal-grpc-port to standalone run options

Signed-off-by: Jigar R Gandhi <jigarr.gandhi@gmail.com>

* Use lib for freeport and accept cmdline args

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add validate logic for port

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add e2e test

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Co-authored-by: Jigar R Gandhi <jigarr.gandhi@gmail.com>
Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-08-09 13:47:11 +05:30
Huei Feng b85eee44d5
adding dapr-http-read-buffer-size parameter to cli (#993)
* Modify path DaprRoot add the SystemDrive environment variable

Signed-off-by: HueiFeng <695979933@qq.com>

* Script for docker install instead of actions-setup-docker (#986)

* Script for docker install instead of actions-setup-docker

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* trigger pr checks

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: HueiFeng <695979933@qq.com>

* Format output of dapr --version as JSON.  (#878)

* Format output of dapr --version as JSON.

Signed-off-by: fanfanbj <fanfanbj@outlook.com>

* Format output of dapr --version as JSON.

Signed-off-by: fanfanbj <fanfanbj@outlook.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: HueiFeng <695979933@qq.com>

* Fix for panic during upgrade of edge version dapr (#983)

* Fix for panic during upgrade of edge version dapr

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* change console log message

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: HueiFeng <695979933@qq.com>

* Add dapr annotate command (#873)

* Add dapr inject command

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* Add additional opts

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* Update comment regarding injection

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* fix some linting issues (more to go)

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* use existing const in tests

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* fix some more linting

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* fix some more linting

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* udpate tests

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* udpate tests

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* add option to run against a URL

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* refactor cmd/inject.go slightly

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* update example text

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* autogenerate appid if not present

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* Update comment

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* Add support for target namespace

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* Update comment

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* Add warning about app id generation to usage

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* fix linting issues

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* rename inject to annotate

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* go mod tidy

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* fix lint

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* update --help URL

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

* add README.md seciton

Signed-off-by: Joni Collinge <jonathancollinge@live.com>

Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Signed-off-by: HueiFeng <695979933@qq.com>

* Update go version to 1.18 (#982)

* Update go version to 1.18

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

* Bumping golangci-lint

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>
Signed-off-by: HueiFeng <695979933@qq.com>

* adding dapr-http-read-buffer-size parameter to cli

Signed-off-by: HueiFeng <695979933@qq.com>

Co-authored-by: Pravin Pushkar <ppushkar@microsoft.com>
Co-authored-by: FanBin <fanfanbj@outlook.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Joni Collinge <jonathancollinge@live.com>
2022-06-09 10:29:43 +05:30
amulyavarote 3684654834
Changed API logging feature on CLI (#936)
* Changed API logging feature on CLI

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Chnaged based on the review comments

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changes based on the review comments in test

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* change to 1.7.0-rc.2

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix linter errors

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

* fix method name

Signed-off-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-03-30 12:27:32 +05:30
amulyavarote db56a250bc
Added api-log-level flag to log api calls (#903)
* Added api-log-level flag to log api calls

Signed-off-by: Amulya Varote <amulyavarote@QTM-SWATHIKIL-1.redmond.corp.microsoft.com>
Signed-off-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>

* Added api-log-level to README

Signed-off-by: Amulya Varote <amulyavarote@QTM-SWATHIKIL-1.redmond.corp.microsoft.com>
Signed-off-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>

* Removed the test case for api-log-level

Signed-off-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>

* Removed Readme changes

Signed-off-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>

* Added back all the changes

Signed-off-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>

* Updated dapr RC version

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* kind e2e changes

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changed README file

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changed dashboard version

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Fixing Go mod tidy.

Signed-off-by: Artur Souza <artursouza.ms@outlook.com>

* Reverted dashboard version

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Reverted dashboard version

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changed dapr dashboard link

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changed dapr dashboard link

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changed version extract link for kind

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* Changed version extract link for self hosted

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* defined variable in kind

Signed-off-by: Amulya Varote <amulyavarote@microsoft.com>

* stadalone e2e test for api log level

Signed-off-by: Pravin Pushkar <ppushkar@microsoft.com>

Co-authored-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Pravin Pushkar <ppushkar@microsoft.com>
2022-03-29 17:34:58 +05:30
Shubham Sharma 9472e6d977
Make CLI exit with error code if dapr run or invoke fails (#905)
* Make CLI exit with error code if dapr or app run fail

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fail when run command returns error

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix test run e2e test

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Fix e2e test cases

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add exit code for invoke

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add exit with error code for process kill failure

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add e2e test for invoke failure

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Invoke invalid app id

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

* Add another error message in e2e test

Signed-off-by: Shubham Sharma <shubhash@microsoft.com>

Co-authored-by: Mukundan Sundararajan <65565396+mukundansundar@users.noreply.github.com>
2022-03-09 19:29:21 +05:30
tanvigour 050eb553f2
Go linter upgrade to 1.44.2 (#908)
* Go linter upgrade to 1.44

Signed-off-by: tanvigour <tanvi.gour@gmail.com>

* remove old excludes and address new ones

Signed-off-by: tanvigour <tanvi.gour@gmail.com>
2022-03-07 13:18:48 +05:30
Anh Le (Andy) 092b93df57
Run: pass missing env variables (#860)
- In the past, I openned this PR: https://github.com/dapr/cli/pull/770
- DCO had some complaints.
- I incorrectly rebased.
- This PR is made by forking the master branch, modifying related files

Signed-off-by: Andy Le <anhldbk@gmail.com>
2022-01-03 09:27:02 -08:00
Dmitry Shmulevich 0f9d0d3a89
replaced license headers (#855)
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-12-10 08:09:09 +05:30
amulyavarote c2ff74370f Added a warning message for unix domain socket (#822)
* Added a warning message for unix domain socket

* Added socket warning message to invoke and publish

* Corrected socket name in publish cmd

* Corrected the variable names for invoke and publish

* Removed unused variables port and grpcPort from invoke and publish

* Cleaned up the error of warning messages

* Cleaned up the wording of warning messages

* Cleaned up the wording of warning messages

* Cleaned up the wording of warning messages on run, invoke and publish

* Modified the warning message

Co-authored-by: Amulya Varote <amulyavarote@Amulyas-MacBook-Pro.local>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2021-11-12 12:40:42 -08:00
Long Dai 4ccf10f9e4
ci: standard linter config (#793)
Signed-off-by: Long <long0dai@foxmail.com>
Signed-off-by: Long <long.dai@intel.com>
2021-11-01 19:01:51 +05:30
Long Dai 4d75238be8
runtime: support unix domain socket (#788)
* runtime: support unix domain socket

Signed-off-by: Long <long.dai@intel.com>

* feedback

Signed-off-by: Long <long.dai@intel.com>

* update example

Signed-off-by: Long <long.dai@intel.com>
2021-10-27 13:45:34 -07:00
Long Dai 909b989128
log error info to stderr (#750)
Signed-off-by: Long Dai <long0dai@foxmail.com>

Co-authored-by: Mukundan Sundararajan <musundar@microsoft.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2021-08-24 23:32:19 -07:00