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

Feature: As a project developer, I want to use the vault data access object that it's specified in the property file #108

Closed
1 task done
csun-cpointe opened this issue May 24, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@csun-cpointe
Copy link
Contributor

csun-cpointe commented May 24, 2024

108Helper.zip

Description

Currently, when package the configuration-store-vault with the configuration store, the vault property dao was discovered in the CDI but can't be injected properly. The vault property dao file should be injected properly so that we can use the data access object that is specified in the property file.

DOD

Acceptance criteria required to complete the work

  • VaultPropertyDao class can be injected and used as it's specified in the application.properties

Test Strategy/Script

  • OTS Only
mvn clean install -pl :foundation-configuration-store
mvn clean install -pl :extensions-configuration-store-vault
mvn clean install -pl :aissemble-configuration-store
  • Create a downstream project
mvn archetype:generate -U -DarchetypeGroupId=com.boozallen.aissemble \
                      -DarchetypeArtifactId=foundation-archetype \
                      -DarchetypeVersion=1.7.0-SNAPSHOT \
                      -DgroupId=com.boozallen.aissemble.test \
                      -DartifactId=test-issue-108 \
                      -DprojectGitUrl=git.example.com/test-issue-108 \
                      -DprojectName="Issue#108 Test"
  • Unzip the 108Helper.zip file.
  • Copy the SparkPipeline.json file to the -pipeline-models/src/main/resources/pipelines directory
  • Repeatedly execute mvn clean install, following the manual actions after each build until no more remain.
  • Unzip and copy the test-issue-108-configuration-store-docker folder to the -docker directory and include the module to the -docker/pom.xml file
    <modules>
       ...
        <module>test-issue-108-configuration-store-docker</module> 
        <!-- TODO: Add docker modules here -->
    </modules>
  • Run mvn clean install
  • Unzip and copy the configuration-store-service folder to be under the -deploy/src/main/resources/app
  • Include below content to the Tiltfile
yaml = helm(
   'test-issue-108-deploy/src/main/resources/apps/config-store-service',
   name='config-store-service',
   values=['test-issue-108-deploy/src/main/resources/apps/config-store-service/values.yaml',
       'test-issue-108-deploy/src/main/resources/apps/config-store-service/values-dev.yaml']
)
k8s_yaml(yaml)

# configuration-store
docker_build(
    ref='boozallen/test-issue-108-configuration-store-docker',
    context='test-issue-108-docker/test-issue-108-configuration-store-docker',
    build_args=build_args,
    dockerfile='test-issue-108-docker/test-issue-108-configuration-store-docker/src/main/resources/docker/Dockerfile'
)
  •  Tilt up; wait for the vault service is ready, scroll up to find the root key, unseal keys,
    ** in the -docker/test-issue-108-configuration-store-docker/src/main/resources/krausening/base/encrypt.properties file, replace the secrets.root.key with the ROOT KEY content
    ** in the -docker/test-issue-108-configuration-store-docker/src/main/resources/krausening/base/encrypt.properties file, replace the secrets.unseal.keys with the UNSEAL KEYS content (make sure to remove the [], ", and any space)
  • Wait until the configuration-store-service is ready, you should see following in the log
18:06:31.613 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.createPropertiesSecretEngine():143 - Configuration properties secret engine does not exist on vault: aissemble-properties/model-training-api
18:06:31.637 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/model-training-api
18:06:31.639 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.createPropertiesSecretEngine():143 - Configuration properties secret engine does not exist on vault: aissemble-properties/data-lineage
18:06:31.649 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/data-lineage
18:06:31.654 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/data-lineage
18:06:31.655 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.createPropertiesSecretEngine():143 - Configuration properties secret engine does not exist on vault: aissemble-properties/messaging
18:06:31.662 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/messaging
18:06:31.667 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/data-lineage
18:06:31.671 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/model-training-api
18:06:31.672 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.createPropertiesSecretEngine():143 - Configuration properties secret engine does not exist on vault: aissemble-properties/aws-access
18:06:31.678 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/aws-access
18:06:31.682 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/data-lineage
18:06:31.685 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/messaging
18:06:31.689 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/data-lineage
18:06:31.693 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/messaging
18:06:31.696 [main] INFO  com.boozallen.aissemble.configuration.dao.VaultPropertyDao.write():116 - Successfully wrote to vault: aissemble-properties/aws-access
18:06:31.696 [main] INFO  com.boozallen.aissemble.configuration.store.ConfigLoader.write():174 - Successfully wrote all properties to the store.
{
"groupName": "model-training-api",
"name": "AWS_SECRET_ACCESS_KEY",
"value": "env-secret-access-key"
} 

References/Additional Context

As needed

@csun-cpointe csun-cpointe added the task Support ticket - typically not code related label May 24, 2024
@csun-cpointe csun-cpointe self-assigned this May 24, 2024
@peter-mcclonski
Copy link
Contributor

DoD/OTS passed

csun-cpointe added a commit that referenced this issue May 28, 2024
csun-cpointe added a commit that referenced this issue May 28, 2024
@csun-cpointe csun-cpointe changed the title TASK: As a project developer, I want to use the vault data access object that it's specified in the property file FEATURE: As a project developer, I want to use the vault data access object that it's specified in the property file May 28, 2024
@csun-cpointe csun-cpointe added enhancement New feature or request and removed task Support ticket - typically not code related labels May 28, 2024
@csun-cpointe csun-cpointe changed the title FEATURE: As a project developer, I want to use the vault data access object that it's specified in the property file Feature: As a project developer, I want to use the vault data access object that it's specified in the property file May 28, 2024
csun-cpointe added a commit that referenced this issue May 29, 2024
#108 vault property dao class can be injected when use the extensions-configuration-store-vault module
@csun-cpointe csun-cpointe added this to the 1.7.0 milestone May 29, 2024
@tianliang0038
Copy link
Contributor

the test has passed
Screenshot 2024-05-29 at 11 14 09 AM

liangyun123 pushed a commit that referenced this issue Jun 12, 2024
liangyun123 pushed a commit that referenced this issue Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants