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

Fixing docsh dependency #138

Merged
merged 4 commits into from
Jul 19, 2021
Merged

Fixing docsh dependency #138

merged 4 commits into from
Jul 19, 2021

Conversation

DenysGonchar
Copy link
Collaborator

minor fixes

@NelsonVides
Copy link
Collaborator

minor fixes

Why? 🤔

@vkatsuba vkatsuba requested review from vkatsuba and removed request for vkatsuba July 17, 2021 08:08
'prod' is a default name for target so renaming it into 'demo', so test scenarios won't be included in a release when amoc is used as a dependecy
unfortunately rebar3 doesn't copy any source files from the directories other than 'src' into release

   denysgonchar@Administrators-MacBook-Pro amoc % find . -name amoc_controller.erl
   ./_build/demo/rel/amoc/lib/amoc-2.2.0+build.788.refbccbc5d/src/amoc_controller.erl
   ./src/amoc_controller.erl
   denysgonchar@Administrators-MacBook-Pro amoc % find . -name parallel_throttle_test.erl
   ./scenarios/parallel_throttle_test.erl

and source code file is required for fetching edoc description for scenario.

So currently, we are not able to get 'doc' field of scenario info, when running amoc inside a container.

when we try to fetch info for parallel_throttle_test scenario:

   http://localhost:4000/scenarios/info/parallel_throttle_test

we get:

   {
     "doc": "no documentation found",
     "parameters": {
   ...

and at the same time the error is logger in amoc console:

   Attempt to process operation: 'ScenariosInfoIdGet'
   Source file for parallel_throttle_test is not available.

If you try to check manually the source file location using docsh_beam module, you get the following:

   (amoc@5441117ebf5d)1> {ok, B1} = docsh_beam:from_loaded_module(parallel_throttle_test).
   {ok,{docsh_beam,parallel_throttle_test,
                   "/home/amoc/amoc/lib/amoc-2.2.0+build.789.ref26c2eb1/ebin/parallel_throttle_test.beam",
                   false}}
   (amoc@5441117ebf5d)2> {ok, B2} = docsh_beam:from_loaded_module(amoc_controller).
   {ok,{docsh_beam,amoc_controller,
                   "/home/amoc/amoc/lib/amoc-2.2.0+build.789.reff907221/ebin/amoc_controller.beam",
                   "/home/amoc/amoc/lib/amoc-2.2.0+build.789.reff907221/src/amoc_controller.erl"}}

however, it's working fine if we preserve source files in the original location:

  (amoc@5441117ebf5d)1> {ok,B} = docsh_beam:from_loaded_module(parallel_throttle_test).
  {ok,{docsh_beam,parallel_throttle_test,
                  "/home/amoc/amoc/lib/amoc-2.2.0+build.789.reff907221/ebin/parallel_throttle_test.beam",
                  "/amoc_build/scenarios/parallel_throttle_test.erl"}}
@DenysGonchar
Copy link
Collaborator Author

minor fixes

Why? 🤔

Because when we use amoc (or any other app) as a dependency, we expect it to have a proper list of its own dependencies. Previously we were only including docsh in amoc release, which is now can be used solely for demo purposes. But amoc-arsenal-release didn't have it, and attempts to extract edoc during scenario/info REST calls were crashing.

BTW, there are also some issues in parsing edoc for some uploaded scenarios, but I haven't investigated that yet.

Copy link
Collaborator

@NelsonVides NelsonVides left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NelsonVides NelsonVides merged commit 18be5c4 into master Jul 19, 2021
@NelsonVides NelsonVides deleted the fixing_docsh_dependency branch July 19, 2021 08:31
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