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 functionality for building and running agents seprately #2845

Merged

Conversation

sarthakvijayvergiya
Copy link
Contributor

@sarthakvijayvergiya sarthakvijayvergiya commented Mar 19, 2024

  1. Added support for building the agent image using 'build'
  2. Implemented the ability to start the agent container with 'start' with host files mounted into docker container
  3. Updated the script to handle the 'resolution' command with its options(build & run)

Build
./demo/run_demo build alice --wallet-type askar-anoncreds --events
Run
./demo/run_demo run alice --wallet-type askar-anoncreds --events

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>
@swcurran
Copy link
Member

I’m not clear on what you mean by the “resolution” functionality. I can see the separation of build and run — is that what you mean?

@sarthakvijayvergiya
Copy link
Contributor Author

I’m not clear on what you mean by the “resolution” functionality. I can see the separation of build and run — is that what you mean?

Yes, the separation of "build" and "run" refers to different functionalities in the script. Specifically, "build" is responsible for building the Docker image of the agent, while "run" executes the agent within a Docker container.

In the "run" functionality, we also mount volumes from the host into the Docker container. This allows for a more streamlined development and debugging process, as we don't need to rebuild the Docker images repeatedly.

Additionally, the script supports a default behavior: if neither "build" nor "run" is specified, it defaults to both building and running the agent.

@sarthakvijayvergiya sarthakvijayvergiya changed the title Add 'resolution' functionality for building and running agents seprately Add functionality for building and running agents seprately Mar 19, 2024
@swcurran
Copy link
Member

Got it — sounds good. Thanks!

@ianco
Copy link
Member

ianco commented Mar 19, 2024

Looks good! Can you add a comment to the docs (maybe here: https://github.com/hyperledger/aries-cloudagent-python/blob/main/docs/demo/README.md#other-environment-settings) describing this? Maybe mention that this can support auto-reloading of code so you don't have to repeatedly restart the demo while developing ...

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>
@sarthakvijayvergiya
Copy link
Contributor Author

Looks good! Can you add a comment to the docs (maybe here: https://github.com/hyperledger/aries-cloudagent-python/blob/main/docs/demo/README.md#other-environment-settings) describing this? Maybe mention that this can support auto-reloading of code so you don't have to repeatedly restart the demo while developing ...

perfect, I have updated the docs.
Thank you!

@ianco
Copy link
Member

ianco commented Mar 19, 2024

Hi @sarthakvijayvergiya , ran a quick test and it looks good.

Just to be clear - when I ran the demo and edited the code, the demo didn't auto-reload. I stopped and restarted the agent (didn't have to rebuild the container) and it picked up the changes. So it's a more efficient process for sure, but should it auto-reload without restarting?

@sarthakvijayvergiya
Copy link
Contributor Author

sarthakvijayvergiya commented Mar 19, 2024

Hi @sarthakvijayvergiya , ran a quick test and it looks good.

Just to be clear - when I ran the demo and edited the code, the demo didn't auto-reload. I stopped and restarted the agent (didn't have to rebuild the container) and it picked up the changes. So it's a more efficient process for sure, but should it auto-reload without restarting?

You're absolutely right. I haven't implemented auto-reloading. The aim was simply to reduce the need for repetitive container builds.

Adding auto-reloading would indeed be a valuable feature, but it's currently outside the scope of this request. However, I'm more than happy to tackle it in a separate request if that's something we'd like to explore further.

Signed-off-by: Sarthak Vijayvergiya <sarthakvijayvergiya@gmail.com>
Copy link

sonarcloud bot commented Mar 19, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@ianco ianco enabled auto-merge March 19, 2024 21:48
@ianco ianco merged commit 9da989c into hyperledger:main Mar 19, 2024
8 checks passed
@sarthakvijayvergiya sarthakvijayvergiya deleted the feat/docker-volume-config-run-demo branch March 19, 2024 22:14
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

Successfully merging this pull request may close these issues.

None yet

3 participants