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

Unable to run background processes #200

Open
rgardler-msft opened this issue Jun 7, 2024 · 2 comments
Open

Unable to run background processes #200

rgardler-msft opened this issue Jun 7, 2024 · 2 comments

Comments

@rgardler-msft
Copy link
Collaborator

It seems that IE can't currently execute background processes. This means that some scripts are not possible, for example, I'm trying to write a doc that will create and deploy a functions + storage application. To do this it is I am using the Functions Core Tools as follows:

Install dependencies

sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt update
sudo apt-get install -y azure-functions-core-tools-4
export FUNCTION_RUNTIME_VERSION="20"
curl -fsSL https://deb.nodesource.com/setup_$FUNCTION_RUNTIME_VERSION.x | sudo -E bash -
sudo apt install -y nodejs
sudo apt install -y npm

Create local functions project.

func init --javascript
npm install

This works when running manually, but the npm install requires return to be pressed to get control back. In IE it never returns control, the "busy" indicator just keeps spinning:

  \[2024-06-07T23:43:03.538Z] Worker process started and initialized.
  /[2024-06-07T23:43:08.535Z] Host lock lease acquired by instance ID '000000000000000000000000B8866BB3'.
  /
@vmarcella
Copy link
Member

Is func init supposed to spawn a new process that lives during the entire execution of the scenario? From IEs perspective, there's no notion of background/foreground processes. Everything in ie is currently treated as a foreground process because executing a command blocks the execution of all other commands until it is finished so that it's result and status can be checked. Commands that have lifetimes which exist beyond the codeblock they're spawned are going to have to be treated differently than commands that don't, but I will need to investigate further into the exact usage you're looking for.

@SorraTheOrc
Copy link
Contributor

SorraTheOrc commented Jun 13, 2024

Yes, it is intended to run a background process. The use case here is that it is the local Azure Functions emulation used when developing functions. However, with my testing so far it seems that using func init is a best practice as it not only creates the local functions server but it also scaffolds the application.

We can work around this by moving the developer parts of the documentation into a different doc and starting our exec doc for deployment from the point of having a working local app. This isn't ideal, but it should work.

Consider this a low pri ask until we get more use cases.

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