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

Add support for concurrent dev instances for separate projects #758

Open
dmeehan1968 opened this issue Jul 25, 2024 · 9 comments
Open

Add support for concurrent dev instances for separate projects #758

dmeehan1968 opened this issue Jul 25, 2024 · 9 comments
Assignees

Comments

@dmeehan1968
Copy link

If there is a sst dev instance running, then attempting to invoke another for a different project gives an error

There's another "sst dev" session running in <path>

It's not clear why there would be this restriction. I certainly appreciate that concurrent instances for the same project wouldn't make sense.

@jayair
Copy link
Contributor

jayair commented Jul 26, 2024

I was just asking Dax about this. I think it's fixed with the new multiplexer update to sst dev. Can you try again?

@jayair jayair self-assigned this Jul 26, 2024
@dmeehan1968
Copy link
Author

dmeehan1968 commented Jul 29, 2024

@jayair I get an error about ssm:GetParameter when scrolling down to the 'dashboard' item (which is my Nextjs resource name), or when I press enter when this item is highlighted.

Screenshot 2024-07-29 at 14 47 51

if I use the 'mode=basic' option then I can run things by having sst dev --mode=basic in one window, and sst dev next dev` in another.

Note that I am still having to use the GODEBUG switch on my Macbook M1 to get around the issue with the Pulumi intel binaries.

Tested with 0.1.51

Copy link
Contributor

thdxr commented Aug 1, 2024

this should work in v 0.1.71

Copy link
Contributor

thdxr commented Aug 1, 2024

what is your dev script for the Dashboard project?

@thdxr thdxr assigned thdxr and unassigned jayair Aug 1, 2024
@dmeehan1968
Copy link
Author

Same thing in 0.1.76.

@thdxr dev script is "dev": "sst dev",.

Screenshot 2024-08-02 at 08 42 17

I tried running with mode=basic and this worked ok.

I checked the Role and indeed there is no ssm:GetParameter permission, only the perms that I added as part of my Nextjs instance (an existing DynamoDB table), and AWSLambdaBasicExecutionRole. Maybe the problem is in merging the permissions, and my custom perms are overriding the SSM perm?

I tried adding the SSM permissions to the Nodejs instance:

        { actions: ['ssm:GetParameter'], resources: ['*'] },

And when run with the multiplexer, I got this:

Screenshot 2024-08-02 at 08 56 34

Whilst I can use the current version with mode=basic it requires me to run two processes, as a dev script with sst dev next dev now gives an error about need to use the multiplexor. This is messy and so I'm currently stuck at 0.1.4.

@jayair
Copy link
Contributor

jayair commented Aug 2, 2024

@dmeehan1968 Dashboard is your next.js app right? For its dev script, can you remove the sst part of it and leave it as next dev?

@dmeehan1968
Copy link
Author

@jayair Yes, that's it, I didn't realise that the dev script needed to be next dev as I'd previously been using as sst dev next dev. Thanks!

@dmeehan1968
Copy link
Author

dmeehan1968 commented Aug 2, 2024

@jayair Note that I'm getting a slew of what looks like environment output when it runs the dev command:

Screenshot 2024-08-02 at 21 59 18

These are my npm scripts:

   "dev": "next dev",
    "sst": "sst dev",

I run in Jetbrains PHPStorm IDE and the new multiplexor seems to interfere with the 'run' window in which the process is launched. I can highlight text but not Cmd-C copy it, and I can't scroll the output produced by the nextjs process, as the mouse/trackpad scroll in the window is being highjacked by the multiplexor (if that's what you call it) nav items on the left, so it just flips between SST, Functions and Dashboard (yes, the name of my project). The up/down arrow keys do the same thing. I can resize the panel in which the process is running which reveals more but its not ideal if I have console output server side for debug purposes.

Of course that might be a Jetbrains shortcoming, but maybe there is an alternative implementation for this new mode that would play more nicely? I don't really want to have a completely separate terminal window for the sst/next server as the IDE has good 'run'/'restart' keyboard shortcuts that make starting/restarting the server as necessary very straightforward. Also the run settings can be saved as part of the project (and yes, I appreciate I could just use npm scripts to do similar).

Ctrl-U does scroll the output backwards, but Ctrl-D interferes with an IDE shortcut (debug the process)

@jayair
Copy link
Contributor

jayair commented Aug 2, 2024

The environment output I noticed as well. Might be a bug in a recent release.

We might have to play around with Jetbrains more for the multiplexer.

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

No branches or pull requests

3 participants