Skip to content

Commit

Permalink
build: modify helm chart version '0.0.1' -> '0.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMin5 committed Nov 29, 2024
1 parent bba4f58 commit 02edace
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 29 deletions.
2 changes: 1 addition & 1 deletion deploy/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1
version: 0.0.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
15 changes: 12 additions & 3 deletions deploy/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enabled: true
developer: false
grpc: true
scheduler: false
worker: false
worker: true
rest: false
name: inventory-v2
image:
Expand Down Expand Up @@ -100,8 +100,17 @@ application_scheduler:

# Overwrite worker config
application_worker:
QUEUES: {}
WORKERS: {}
QUEUES:
inventory_q:
backend: spaceone.core.queue.redis_queue.RedisQueue
host: redis
port: 6379
channel: inventory_job
WORKERS:
inventory_worker:
backend: spaceone.core.scheduler.worker.BaseWorker
queue: inventory_q
pool: 1

##########################
# local sidecar
Expand Down
66 changes: 41 additions & 25 deletions src/spaceone/inventory_v2/manager/job_task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from spaceone.core.model.mongo_model import QuerySet

from spaceone.inventory_v2.manager.job_manager import JobManager

# from spaceone.inventory.manager.cleanup_manager import CleanupManager
from spaceone.inventory_v2.model.job_task.database import JobTask

Expand All @@ -31,11 +32,11 @@ def _rollback(vo: JobTask):
return job_task_vo

def get(
self,
job_task_id: str,
domain_id: str,
workspace_id: str = None,
user_projects: list = None,
self,
job_task_id: str,
domain_id: str,
workspace_id: str = None,
user_projects: list = None,
) -> JobTask:
conditions = {
"job_task_id": job_task_id,
Expand All @@ -60,17 +61,32 @@ def stat(self, query: dict) -> dict:
return self.job_task_model.stat(**query)

def push_job_task(self, params: dict) -> None:
task = self.create_task_pipeline(copy.deepcopy(params))
token = self.transaction.meta.get("token")
params["token"] = token
task = {
"name": "collecting_resources",
"version": "v1",
"executionEngine": "BaseWorker",
"stages": [
{
"locator": "MANAGER",
"name": "CollectingManager",
"metadata": {},
"method": "collecting_resources",
"params": {"params": params},
}
],
}

validate(task, schema=SPACEONE_TASK_SCHEMA)
json_task = json.dumps(task)
queue.put(self.get_queue_name(name="collect_queue"), json_task)
queue.put("inventory_q", utils.dump_json(task))

@staticmethod
def add_error(
job_task_vo: JobTask,
error_code: str,
error_message: str,
additional: dict = None,
job_task_vo: JobTask,
error_code: str,
error_message: str,
additional: dict = None,
) -> None:
error_info = {"error_code": error_code, "message": str(error_message).strip()}

Expand All @@ -84,10 +100,10 @@ def add_error(

@staticmethod
def _update_job_status_by_vo(
job_task_vo: JobTask,
status: str,
started_at: datetime = None,
finished_at: datetime = None,
job_task_vo: JobTask,
status: str,
started_at: datetime = None,
finished_at: datetime = None,
) -> None:
params = {"status": status}

Expand All @@ -104,8 +120,8 @@ def _update_job_status_by_vo(
job_task_vo.update(params)

def make_inprogress_by_vo(
self,
job_task_vo: JobTask,
self,
job_task_vo: JobTask,
) -> None:
if job_task_vo.status == "PENDING":
self._update_job_status_by_vo(
Expand All @@ -115,8 +131,8 @@ def make_inprogress_by_vo(
)

def make_success_by_vo(
self,
job_task_vo: JobTask,
self,
job_task_vo: JobTask,
) -> None:
self._update_job_status_by_vo(
job_task_vo,
Expand All @@ -125,9 +141,9 @@ def make_success_by_vo(
)

def make_failure_by_vo(
self,
job_task_vo: JobTask,
collecting_count_info: dict = None,
self,
job_task_vo: JobTask,
collecting_count_info: dict = None,
) -> None:
self._update_job_status_by_vo(
job_task_vo,
Expand All @@ -138,7 +154,7 @@ def make_failure_by_vo(
self.decrease_remained_sub_tasks(job_task_vo, collecting_count_info)

def decrease_remained_sub_tasks(
self, job_task_vo: JobTask, collecting_count_info: dict = None
self, job_task_vo: JobTask, collecting_count_info: dict = None
) -> JobTask:
if collecting_count_info:
self._update_collecting_count_info(job_task_vo, collecting_count_info)
Expand All @@ -165,7 +181,7 @@ def decrease_remained_sub_tasks(

@staticmethod
def _update_collecting_count_info(
job_task_vo: JobTask, collecting_count_info: dict
job_task_vo: JobTask, collecting_count_info: dict
) -> None:
_LOGGER.debug(
f"[_update_collecting_count_info] update collecting count => {utils.dump_json(collecting_count_info)}"
Expand Down

0 comments on commit 02edace

Please sign in to comment.