Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshu219 committed Nov 8, 2024
1 parent 493da4e commit 5de54c5
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
49 changes: 31 additions & 18 deletions INTERNAL_README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
We use sumoappclient for testing the lambda paackage. We can install it by:
```
pip install sumologic-sdk
```
Description:
```
sumoappclient [-h] [-e {onprem,aws,gcp,azure}] [-d {prod,test,local}] [-c CONFIGPATH] [-pc PYTHON_CMD] [-g TARGET_FOLDER]
```
### OnPrem

Deployment testing for PyPi:
1. For onprem pypi testing of this package, we perform these steps:
* Upgrade the version in the Version file, eg 1.0.10 -> 1.0.11
1. For generating the build and running locally, we perform these steps:

* Upgrade the version in the `VERSION` file, eg 1.0.10 -> 1.0.11
* Run the `build.sh`.
* Create a `mongodbatlas.yaml` in home folder (for ex ~/sumo/mongodbatlas.yaml), refer the `sumomongodbatlascollector/mongodbatlas.yaml` file for instructions on each of the parameter. You can override any parameter in this file
```
SumoLogic:
HTTP_LOGS_ENDPOINT: <Paste the HTTP Logs source URL from step 2.>
HTTP_METRICS_ENDPOINT: <Paste the HTTP Metrics source URL from step 2.>
MongoDBAtlas:
ORGANIZATION_ID: <Paste the Organization ID from step 1.>
PROJECT_ID: <Paste the Project ID from step 1.>
PRIVATE_API_KEY: <Paste the Private Key from step 1.>
PUBLIC_API_KEY: <Paste the Public Key from step 1.>
```
* Run the below command to start the collector
```
python -m sumomongodbatlascollector.main ~/sumo/mongodbatlas.yaml
```
2. For deploying on test pypi account we perform these steps:
* Run the following command:
```
sumoappclient -d sumotest -c mongodbatlas.yaml -e onprem
python -m twine upload dist/* --repository sumotestpypi
```
* This deploys the package in the testing org of pypi via the credentials stored in the .pypirc file for the sumotestpypi section. You can find the file in the shared vault.
2. For onprem pypi production deployment, we perform these steps:
* Upgrade the version in the Version file, eg 1.0.10 -> 1.0.11
3. For deploying on prod pypi account we perform these steps:
* Run the following command:
```
sumoappclient -d sumopypi -c mongodbatlas.yaml -e onprem
python -m twine upload dist/* --repository sumopypi
```
* This deploys the package in the production org of pypi via the credentials stored in the .pypirc file for the sumopypi section. You can find the file in the shared vault.
Deployment testing for AWS:
1. For testing of this package, we perform these steps:
### AWS
1. For testing and deploying the lambda function, we perform these steps:
* Update .aws file to use a personal aws account credentials.
* Create a S3 bucket in the personal aws account.
* In samconfig.toml file update s3_bucket, region parameters.
Expand All @@ -37,7 +49,8 @@ Deployment testing for AWS:
sam deploy
```
* This deploys the package via a personal aws account onto AWS Serverless Application Repository
2. For production deployment, we perform these steps:
* After deploying go the lambda function created by above command and run the function by clicking on test button.
2. For publishing the sam application, we perform these steps:
* Update the s3_bucket parameter to appdevstore bucket
* Run the following command:
```
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
python setup.py bdist_wheel
pip uninstall -y sumologic_mongodb_atlas
pip install dist/sumologic_mongodb_atlas-1.0.11*.whl
pip install dist/sumologic_mongodb_atlas*.whl
2 changes: 1 addition & 1 deletion sumomongodbatlascollector/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _get_all_processes_from_project(self):
all_cluster_aliases = list({self._get_cluster_name(obj["userAlias"]) for data in all_data for obj in data["results"]})
user_provided_clusters = self._get_user_provided_cluster_name()

if len(user_provided_clusters) > 0:
if len(all_cluster_aliases) > 0 and len(user_provided_clusters) > 0:
cluster_mapping = {}
process_ids = set()
hostnames = set()
Expand Down

0 comments on commit 5de54c5

Please sign in to comment.