Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
Helm-Automation-Script
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
harshavardhan.c
Helm-Automation-Script
Commits
1f8bac27
Commit
1f8bac27
authored
May 16, 2023
by
prakash.raguri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix-16-05-2023
parent
14f387aa
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
656 deletions
+20
-656
.env
.env
+4
-0
data.yaml
data.yaml
+4
-0
helm_automation/helm_automate_script.py
helm_automation/helm_automate_script.py
+8
-2
logs/helm-automation-script.log
logs/helm-automation-script.log
+0
-652
scripts/config/__init__.py
scripts/config/__init__.py
+4
-2
No files found.
.env
View file @
1f8bac27
...
@@ -6,3 +6,7 @@ HELM_REPO = https://gitlab-pm.knowledgelens.com/KnowledgeLens/Products/iLens-2.0
...
@@ -6,3 +6,7 @@ HELM_REPO = https://gitlab-pm.knowledgelens.com/KnowledgeLens/Products/iLens-2.0
GIT_USERNAME = harshavardhan.c
GIT_USERNAME = harshavardhan.c
GIT_TOKEN = FEMA6PnP63fJCs6DrtZJ
GIT_TOKEN = FEMA6PnP63fJCs6DrtZJ
GLOBAL_VARIABLES_FILE=ilens-env-spec-variables.yml
GLOBAL_VARIABLES_FILE=ilens-env-spec-variables.yml
data.yaml
View file @
1f8bac27
...
@@ -25,6 +25,10 @@ deployment:
...
@@ -25,6 +25,10 @@ deployment:
limits
:
limits
:
memory
:
<{ limit_memory | default("750Mi") }>
memory
:
<{ limit_memory | default("750Mi") }>
cpu
:
<{ limit_cpu | default("500Mi") }>
cpu
:
<{ limit_cpu | default("500Mi") }>
environmentConfig
:
envFrom
:
-
configMapRef
:
name
:
ilens-global-variables
environmentVar
:
environmentVar
:
-
name
:
MONGO_URI
-
name
:
MONGO_URI
...
...
helm_automation/helm_automate_script.py
View file @
1f8bac27
...
@@ -22,6 +22,11 @@ HELM_STORE_PATH = "./helm-charts"
...
@@ -22,6 +22,11 @@ HELM_STORE_PATH = "./helm-charts"
global_configmap
=
EnvironmentVariables
.
global_configmap
global_configmap
=
EnvironmentVariables
.
global_configmap
helm_repo
=
EnvironmentVariables
.
helm_repo
helm_repo
=
EnvironmentVariables
.
helm_repo
mapping_json
=
{
"visualization-4"
:
"visualization4.0"
,
"metadata-service"
:
"metadata-services"
}
class
HelmVersionUpgrade
:
class
HelmVersionUpgrade
:
def
__init__
(
self
,
arguments
:
dict
,
git_user_name
:
str
,
git_access_token
:
str
):
def
__init__
(
self
,
arguments
:
dict
,
git_user_name
:
str
,
git_access_token
:
str
):
...
@@ -75,6 +80,7 @@ class HelmVersionUpgrade:
...
@@ -75,6 +80,7 @@ class HelmVersionUpgrade:
if
not
os
.
path
.
exists
(
template_path
):
if
not
os
.
path
.
exists
(
template_path
):
os
.
makedirs
(
template_path
)
os
.
makedirs
(
template_path
)
for
_module
in
_module_names
:
for
_module
in
_module_names
:
updated_module_name
=
mapping_json
.
get
(
_module
,
_module
)
if
_module
==
"data"
:
if
_module
==
"data"
:
continue
continue
helm_out_file_path
=
os
.
path
.
join
(
output_path
,
f
'{_module}.yml'
)
helm_out_file_path
=
os
.
path
.
join
(
output_path
,
f
'{_module}.yml'
)
...
@@ -88,7 +94,7 @@ class HelmVersionUpgrade:
...
@@ -88,7 +94,7 @@ class HelmVersionUpgrade:
logging
.
debug
(
f
"Helm Deployment File found for selected the module {_module}"
)
logging
.
debug
(
f
"Helm Deployment File found for selected the module {_module}"
)
continue
continue
variables_file_path
=
os
.
path
.
join
(
module_path
,
variables_file
)
variables_file_path
=
os
.
path
.
join
(
module_path
,
variables_file
)
git_info
=
self
.
git_handler_obj
.
get_git_url_by_module_name
(
module_name
=
_modul
e
)
git_info
=
self
.
git_handler_obj
.
get_git_url_by_module_name
(
module_name
=
updated_module_nam
e
)
if
not
git_info
:
if
not
git_info
:
logging
.
debug
(
"Failed to fetch module info!! Skipping Helm File Preparation"
)
logging
.
debug
(
"Failed to fetch module info!! Skipping Helm File Preparation"
)
continue
continue
...
@@ -107,7 +113,7 @@ class HelmVersionUpgrade:
...
@@ -107,7 +113,7 @@ class HelmVersionUpgrade:
template_file
=
os
.
path
.
join
(
template_path
,
f
'{_module}.yml'
)
template_file
=
os
.
path
.
join
(
template_path
,
f
'{_module}.yml'
)
session_obj
=
get_db_for_func
()
session_obj
=
get_db_for_func
()
module_info
=
self
.
db_handler
.
get_module_versions
(
module_info
=
self
.
db_handler
.
get_module_versions
(
input_data
=
GetRequest
(
module_name
=
_modul
e
,
client
=
'iLens'
,
ilens_version
=
_ilens_version
,
input_data
=
GetRequest
(
module_name
=
updated_module_nam
e
,
client
=
'iLens'
,
ilens_version
=
_ilens_version
,
release_version
=
_release_version
),
db
=
session_obj
)
release_version
=
_release_version
),
db
=
session_obj
)
session_obj
.
close
()
session_obj
.
close
()
image_url
=
module_info
.
get
(
"image_url"
,
''
)
if
module_info
else
''
image_url
=
module_info
.
get
(
"image_url"
,
''
)
if
module_info
else
''
...
...
logs/helm-automation-script.log
View file @
1f8bac27
This diff is collapsed.
Click to expand it.
scripts/config/__init__.py
View file @
1f8bac27
...
@@ -61,8 +61,10 @@ class EnvironmentVariables:
...
@@ -61,8 +61,10 @@ class EnvironmentVariables:
class
_ModuleConstants
(
BaseSettings
):
class
_ModuleConstants
(
BaseSettings
):
IOT_DATA_PROCESSOR
:
Optional
[
list
]
=
[
"mqtt-data-processor-worker"
,
"iot-data-processor-worker"
]
IOT_DATA_PROCESSOR
:
Optional
[
list
]
=
[
"mqtt-data-processor-worker"
,
"iot-data-processor-worker"
,
"data-processor-worker-iot-apollo"
,
"data-processor-worker-iot-goodyear"
,
"data-processor-worker-mqtt"
]
IOT_DATA_PROCESSOR_MODULE
:
Optional
[
str
]
=
"data-processor-worker"
IOT_DATA_PROCESSOR_MODULE
:
Optional
[
str
]
=
"data-processor-worker"
# CORE_DATA_PROCESSOR: Optional[list] = ["", ""]
# CORE_DATA_PROCESSOR_MODULE: Optional[str] = "data-processor"
ModuleConstants
=
_ModuleConstants
(
_env_file
=
".env"
,
_env_file_encoding
=
"utf-8"
)
ModuleConstants
=
_ModuleConstants
(
_env_file
=
".env"
,
_env_file_encoding
=
"utf-8"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment