[FOLIO-3546] Include edge-inn-reach and dependencies in vagrant builds Created: 27/Jul/22  Updated: 16/Sep/22  Resolved: 16/Sep/22

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Story Priority: TBD
Reporter: Steve Ellis Assignee: Wayne Schneider
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: File ephemeral.properties     PNG File image-2022-09-15-18-07-26-719.png    
Issue links:
Blocks
blocks FAT-1567 edge-inn-reach: Implement API Karate ... Closed
blocks FAT-1568 edge-inn-reach: Implement API Karate ... Closed
blocks FAT-1569 edge-inn-reach: Implement API Karate ... Closed
blocks FAT-1570 edge-inn-reach: Implement API Karate ... Closed
Sprint: DevOps Sprint 146, DevOps Sprint 145
Development Team: FOLIO DevOps
RCA Group: TBD

 Description   

Currently the only way to run Karate integration tests for edge-inn-reach is to use one of the snapshot vagrant boxes locally due to how mod-inn-reach uses mocks. However edge-inn-reach isn't currently included in the vagrant box and we have a number of karate test scenarios that require it.



 Comments   
Comment by Wayne Schneider [ 27/Jul/22 ]

Jakub Skoczen I discussed with Steve and will try to pick this up in this sprint.

Comment by Wayne Schneider [ 03/Aug/22 ]

Steve Ellis I'm not sure how to set this up, actually. Here are my questions:

First, a few other edge modules that use the Vagrant box for Karate testing use a test tenant (e.g. test_edge_orders) rather than the diku tenant. Is that required for edge-inn-reach?

Second, the Deployment information section of the README is horribly confusing. What should the tenantMappings property look like in the Vagrant box ephemeral.properties file? On folio-snapshot, it looks like:

tenantsMappings=fli01:diku

Finally, does some configuration need to happen before starting up edge-inn-reach? The README says:

Create InnReach Central Server configuration

  1. Log in to Folio, go to "Settings" -> "INN-Reach" -> "Central server configuration", click "New" button.
  2. Fill in all the required fields
  3. Press Generate keypair for Local server key and local server secret generation
  4. Press save & close
    Note: InnReach Central Server configuration settings applied only upon module startup, so in case of their changes, edge-inn-reach service must be restarted.

Are there test configuration settings we can include in the Vagrant box? Note that those settings would be stored in the public GitHub repository folio-org/folio-ansible. Do we need to use the mod-inn-reach Settings API to do this? What values should be included in the POST payload?

Comment by Steve Ellis [ 03/Aug/22 ]

Wayne Schneider - Thanks for taking a  look and for your questions. After looking at the readme I share your confusion! We will improve that text. In any case, I will get answers to your questions. and post them back here when I have them.

I think the answer to your first question is yes, we will require a test tenant like the other edge modules that are doing unit tests.

Comment by Steve Ellis [ 04/Aug/22 ]

Wayne Schneider - We were able to get some clarity on this. Thank you Gurleen Kaur1 for talking through it with me.

For your first question, yes we do want our own test tenant. This tenant can be called test_tenant. It should match what's present in the ephemeral props file (see below).

For your second question you can just use the ephemeral.properties file that is in our master branch: https://github.com/folio-org/edge-inn-reach/blob/master/src/main/resources/ephemeral.properties. This has a hardcoded UUID for what is called the "local server key". When the code sees this special UUID it will allow things to work the way we want for the karate tests.

For your third question, no we don't need a central server to be configured. That's what that hardcoded UUID takes care of in this case.

Let me know if that gives you enough to proceed. Thanks again for helping us out on this!

Comment by Wayne Schneider [ 12/Aug/22 ]

This has been done. The test tenant is named test_edge_inn_reach, and the institutional user is innreachClient. The edge module should be available on the Vagrant box at port 8000 internally, port 8130 externally, path /innreach.

Please give it a try and let me know if you have any problems. Thanks!

Comment by Nirmal R Shah [ 16/Aug/22 ]

ok Wayne Schneider .
Let us verify and revert here with confirmation.

Thanks!!

FYI Gurleen Kaur1 Arin Suryavanshi Arghya Mitra 

Comment by Nirmal R Shah [ 16/Aug/22 ]

Hi Wayne Schneider   How do you start edge-inn-reach in docker?
Could you please provide that command?command
-------------------------------------------------------------------------------------------------------------------------------------
 docker run -d -e "secure_store_props=/etc/edge/ephemeral.properties" -e "log_level=DEBUG" -e "innreach_client=diku_admin" -e "OKAPI_URL=http://127.0.0.1:9130" -p 9703:8081/tcp -t folioci/edge-inn-reach:latest
-------------------------------------------------------------------------------------------------------------------------------------
Regarding : https://folio-org.atlassian.net/browse/FOLIO-3546 (edited) 

FYI Gurleen Kaur1 Arin Suryavanshi Arghya Mitra 

Comment by Nirmal R Shah [ 18/Aug/22 ]

Hi Wayne Schneider 

Requesting you to please share the docker command parameter through which we can refer to our own ephemeral.properties file explicitly!!

FYI Gurleen Kaur1 Arin Suryavanshi Arghya Mitra Steve Ellis 

Comment by Wayne Schneider [ 06/Sep/22 ]

The edge-inn-reach container is started with two additional environment variables:

        JAVA_OPTIONS: "-XX:MaxRAMPercentage=66.0"
        LOG4J_FORMAT_MSG_NO_LOOKUPS: "true"

The docker CMD is set to:

--okapi_url=http://10.0.2.15:9130 --secure_store_props=/mnt/edge-inn-reach-ephemeral.properties

The "ephemeral" secure store looks like this:

secureStore.type=Ephemeral
# a comma separated list of tenants
tenants=diku,test_edge_inn_reach
#######################################################
# For each tenant, the institutional user password...
#
# Note: this is intended for development purposes only
#
# extra tenants for integration tests, see FOLIO-2647 and FOLIO-3122
#######################################################
diku=innreachClient,diku
test_edge_inn_reach=innReachClient,test
# extra configuration required for edge-inn-reach
tenantsMappings=fli01:diku,fli01:test_edge_inn_reach

My understanding is that where it currently reads fli01, it should instead read 5858f9d8-1558-4513-aa25-bad839eb803a. Is this correct? Are there any other required changes?

I was also asked if the test_edge_inn_reach tenant is created by the build. It is not created, it is only referred to in the secure store.

Once I have confirmation of the required changes, I will update the build playbook and run a build for you to test. Thanks!

Comment by Nirmal R Shah [ 08/Sep/22 ]

hi Wayne Schneider 

Though we have already tested it a long back, we just need one more round of karate testing from our side before confirming for above changes in the ephemeral.properties file.

So, we will confirm with you here as soon as we complete our testing.

Thanks

FYI Gurleen Kaur1 Steve Ellis Arin Suryavanshi Arghya Mitra 

Comment by Nirmal R Shah [ 08/Sep/22 ]

HI Wayne Schneider 

We completed karate testing and here with attaching the final version of ephemeral properties for the edge-inn-reach module to be deployed in vagrant.

ephemeral.properties

 

FYI Gurleen Kaur1 Steve Ellis Arin Suryavanshi Arghya Mitra 

Comment by Wayne Schneider [ 08/Sep/22 ]

A new Vagrant box has been created with the updates requested (folio/snapshot v1.0.0-20220908.7779). Please test it and let me know if this issue can be closed. Thanks!

Comment by Nirmal R Shah [ 15/Sep/22 ]

Hi Wayne Schneider 

Sorry for delay, but were facing some issues while testing with vagrant with given ephemeral.properties file.
What we found is that due to the capital case for the letter R in below line it causes the problem of getting settings file and giving

Unable to parse authorization token error

Line : test_edge_inn_reach=innReachClient,test

 

So, requesting you to please use the latest file ephemeral.properties attached, which has correction for innreachClient.

FYI Gurleen Kaur1 Steve Ellis Arin Suryavanshi Arghya Mitra 

 

Comment by Wayne Schneider [ 15/Sep/22 ]

New Vagrant box folio/snapshot v1.0.0-20220915.7787 has been created with this update. Please test and let me know if it works.

Comment by Nirmal R Shah [ 16/Sep/22 ]

Hi Wayne Schneider,

Tested for the above-mentioned version of vagrant v1.0.0-20220915.7787, and it's working fine.

we are good to close this Jira ticket.

FYI Gurleen Kaur1 Steve Ellis Arin Suryavanshi Arghya Mitra 

Generated at Thu Feb 08 23:28:56 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.