forked from alibaba/SREWorks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e97e00a
commit 868048d
Showing
246 changed files
with
2,818 additions
and
601 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
paas/appmanager/APP-META-PRIVATE/db/131_add_app_version.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
CREATE TABLE `am_app_version` | ||
( | ||
`id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', | ||
`gmt_create` datetime NULL COMMENT '创建时间', | ||
`gmt_modified` datetime NULL COMMENT '最后修改时间', | ||
`app_id` varchar(64) NULL COMMENT '应用 ID (为空则全局)', | ||
`version` varchar(64) NULL COMMENT '版本号', | ||
`version_label` varchar(128) NULL COMMENT '版本标签', | ||
`version_properties` longtext COMMENT '版本属性', | ||
PRIMARY KEY (`id`), | ||
KEY `idx_gmt_create` (`gmt_create`), | ||
KEY `idx_gmt_modified` (`gmt_modified`), | ||
KEY `idx_app_id` (`app_id`), | ||
KEY `version` (`version`), | ||
KEY `version_label` (`version_label`) | ||
) DEFAULT CHARACTER SET = utf8mb4 COMMENT ='应用版本表'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
paas/appmanager/APP-META-PRIVATE/postrun/07_init_check_initjob.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# coding: utf-8 | ||
|
||
import logging | ||
import os | ||
|
||
import sys | ||
import time | ||
import kubernetes | ||
|
||
|
||
logger = logging.getLogger() | ||
logger.setLevel(logging.INFO) | ||
|
||
handler = logging.StreamHandler(sys.stdout) | ||
handler.setLevel(logging.INFO) | ||
formatter = logging.Formatter('[%(asctime)s] [%(module)s.%(funcName)s:%(lineno)d] [%(levelname)s] - %(message)s') | ||
handler.setFormatter(formatter) | ||
logger.addHandler(handler) | ||
|
||
|
||
def main(): | ||
""" | ||
appmanager已经部署成功,但是initjob未正确创建 | ||
""" | ||
paas2 = os.getenv("PAAS_VERSION") | ||
if paas2: | ||
return | ||
namespace = "apsara-bigdata-manager" | ||
initjob = "abm-appmanager-initjob" | ||
version = "v1" | ||
plural = "appmanager" | ||
name = "appmanager" | ||
group = "abm.io" | ||
|
||
success = False | ||
kubernetes.config.load_incluster_config() | ||
job_api = kubernetes.client.BatchV1Api() | ||
api = kubernetes.client.CustomObjectsApi() | ||
body = { | ||
"metadata": { | ||
"labels": { | ||
"a": str(int(time.time()*1000))} | ||
} | ||
} | ||
time.sleep(60) | ||
while True: | ||
try: | ||
success = job_api.read_namespaced_job_status(initjob, namespace) | ||
except Exception as e: | ||
logger.error("%s find fail, error=%s" % (initjob, e.__str__())) | ||
if success: | ||
logger.info("%s already create" % initjob) | ||
return | ||
result = api.patch_namespaced_custom_object(group, version, namespace, plural, name, body) | ||
logger.info("patch %s result=%s" % (name, result)) | ||
time.sleep(600) | ||
|
||
if __name__ == '__main__': | ||
main() |
12 changes: 0 additions & 12 deletions
12
paas/appmanager/APP-META-PRIVATE/postrun/traits/privateCloudArkhas.trait.abm.io.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 0 additions & 122 deletions
122
...va/com/alibaba/tesla/appmanager/common/channel/enums/ChannelInvocationHostStatusEnum.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.