Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/alibaba/SREWorks
Browse files Browse the repository at this point in the history
  • Loading branch information
Antuw committed May 17, 2022
2 parents 212fd1c + afab0eb commit d476bf6
Show file tree
Hide file tree
Showing 10 changed files with 59 additions and 38 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
paas/swcli/builtin_package/
paas/action/test.sh

.DS_Store
*.log
mvn_deploy.sh
mvn_install.sh
14 changes: 4 additions & 10 deletions paas/appmanager/tesla-appmanager-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-test-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
Expand Down Expand Up @@ -247,15 +251,5 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-stream-binder-kafka</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.tesla.appmanager.common.constants.AppFlowParamKey;
import com.alibaba.tesla.appmanager.common.constants.AppFlowVariableKey;
import com.alibaba.tesla.appmanager.common.constants.DefaultConstant;
import com.alibaba.tesla.appmanager.common.constants.TraitRuntimeConstant;
Expand Down Expand Up @@ -47,7 +46,6 @@
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.*;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -314,11 +312,11 @@ private Long deployComponents(
if (StringUtils.isEmpty(appInstanceName)) {
appInstanceName = appInstanceId;
}
// 针对 appmeta / deploymentmeta 两个特殊的 INTERNAL_ADDON component, 默认不进行应用实例的创建
// 针对 appmeta / developmentmeta 两个特殊的 INTERNAL_ADDON component, 默认不进行应用实例的创建
DeployAppRevisionName revision = DeployAppRevisionName.valueOf(specComponent.getRevisionName());
if (ComponentTypeEnum.INTERNAL_ADDON.equals(revision.getComponentType())
&& ("appmeta".equals(revision.getComponentName())
|| "deploymentmeta".equals(revision.getComponentName()))) {
|| "developmentmeta".equals(revision.getComponentName()))) {
continue;
}
RtAppInstanceDO appInstance = rtAppInstanceService.getOrCreate(RtAppInstanceQueryCondition.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ public void run() {
String namespaceId = componentInstance.getNamespaceId();
String stageId = componentInstance.getStageId();

// 针对 appmeta / deploymentmeta 两个特殊的 INTERNAL_ADDON component, 不进行应用实例的创建
// 针对 appmeta / developmentmeta 两个特殊的 INTERNAL_ADDON component, 不进行应用实例的创建
String componentType = componentInstance.getComponentType();
String componentName = componentInstance.getComponentName();
if (ComponentTypeEnum.INTERNAL_ADDON.toString().equals(componentType)
&& ("appmeta".equals(componentName) || "deploymentmeta".equals(componentName))) {
&& ("appmeta".equals(componentName) || "developmentmeta".equals(componentName))) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"com.alibaba.tesla.appmanager.meta.helm.repository.mapper",
"com.alibaba.tesla.appmanager.meta.k8smicroservice.repository.mapper",
"com.alibaba.tesla.appmanager.deployconfig.repository.mapper",
"com.alibaba.tesla.appmanager.workflow.repository.mapper",
"com.alibaba.tesla.dag.repository.mapper"
})
@EnableTransactionManagement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ management.metrics.export.prometheus.enabled=true
# Storage - Bucket
appmanager.package.driver=minio
appmanager.package.endpoint=minio:9000
appmanager.package.access-key=ZGLTytNPH4
appmanager.package.secret-key=9KGRHUB9d3wkmy0YAOXcUpuyGUusXD9Fa2g8fI2V
appmanager.package.access-key=super_access_key
appmanager.package.secret-key=super_secret_key
appmanager.package.bucket-name=appmanager
appmanager.package.in-unit-test=true
# Auth
Expand Down Expand Up @@ -56,9 +56,9 @@ dag.hot.load.jar.interval.second=2
dag.usage.mode=jar
# OSS
dag.hot.load.jar.minio.endpoint=http://minio:9000
dag.hot.load.jar.minio.accessKeyId=ZGLTytNPH4
dag.hot.load.jar.minio.accessKeySecret=9KGRHUB9d3wkmy0YAOXcUpuyGUusXD9Fa2g8fI2V
dag.hot.load.jar.minio.bucket.name=appmanager-dag-x
dag.hot.load.jar.minio.accessKeyId=super_access_key
dag.hot.load.jar.minio.accessKeySecret=super_secret_key
dag.hot.load.jar.minio.bucket.name=appmanager-dag
# redis
spring.redis.host=redis
spring.redis.port=6379
Expand All @@ -82,13 +82,3 @@ appmanager.cluster.docker-daemon=tcp://127.0.0.1:2375
logging.level.com.alibaba.tesla.dag=ERROR
logging.level.job=ERROR
logging.level.monitor=ERROR
### Message Queue
spring.cloud.stream.kafka.binder.brokers=192.168.40.157
spring.cloud.stream.kafka.binder.defaultBrokerPort=9094
spring.cloud.stream.bindings.doComponentPackageInput.destination=master_tesla_appmanager_component_package_topic
spring.cloud.stream.bindings.doComponentPackageInput.contentType=application/json
spring.cloud.stream.bindings.doComponentPackageInput.group=CID_master_TESLA_APPMANAGER_COMPONENT_PACKAGE_GROUP
spring.cloud.stream.bindings.doComponentPackageInput.consumer.concurrency=30
spring.cloud.stream.bindings.doComponentPackageOutput.destination=master_tesla_appmanager_component_package_topic
spring.cloud.stream.bindings.doComponentPackageOutput.group=PID_master_TESLA_APPMANAGER_COMPONENT_PACKAGE_GROUP
spring.cloud.stream.bindings.doComponentPackageOutput.contentType=application/json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"branch": "develop",
"repo": "http://gitlab.alibaba-inc.com/pe3/appmanager-python-demo.git",
"imagePush": true,
"imagePushRegistry": "reg.docker.alibaba-inc.com/abm-oxs",
"imagePushUseBranchAsTag": true
"imagePushRegistry": "192.168.64.155:5000/abm-oxs"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
"repo": "http://gitlab.alibaba-inc.com/pe3/appmanager-python-demo.git",
"branch": "develop",
"imagePush": true,
"imagePushRegistry": "reg.docker.alibaba-inc.com/abm-oxs",
"imagePushUseBranchAsTag": true
"imagePushRegistry": "192.168.64.155:5000/abm-oxs"
},
"name": "job"
},
Expand Down
5 changes: 5 additions & 0 deletions saas/app/api/build.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,8 @@ options:
- APPMANAGER_CLIENT_SECRET
- AUTHPROXY_ENDPOINT

---

componentType: RESOURCE_ADDON
componentName: system-env@system-env
options: {}
39 changes: 36 additions & 3 deletions saas/app/api/launch.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ spec:
value: "prod"
components:
- revisionName: K8S_MICROSERVICE|app|_
dependencies:
- component: RESOURCE_ADDON|system-env@system-env
scopes:
- scopeRef:
apiVersion: apps.abm.io/v1
Expand Down Expand Up @@ -68,7 +70,38 @@ spec:
value: "${APPMANAGER_CLIENT_ID}"
- name: Global.APPMANAGER_CLIENT_SECRET
value: "${APPMANAGER_CLIENT_SECRET}"



- dataInputs: []
dataOutputs:
- fieldPath: '{{ spec.env.DB_HOST }}'
name: Global.DB_HOST
- fieldPath: '{{ spec.env.DB_PASSWORD }}'
name: Global.DB_PASSWORD
- fieldPath: '{{ spec.env.DB_PORT }}'
name: Global.DB_PORT
- fieldPath: '{{ spec.env.DB_USER }}'
name: Global.DB_USER
dependencies: []
parameterValues:
- name: keys
toFieldPaths:
- spec.keys
value:
- DB_HOST
- DB_PASSWORD
- DB_PORT
- DB_USER
revisionName: RESOURCE_ADDON|system-env@system-env|1.0
scopes:
- scopeRef:
apiVersion: core.oam.dev/v1alpha2
kind: Stage
name: "{{ Global.STAGE_ID }}"
- scopeRef:
apiVersion: core.oam.dev/v1alpha2
kind: Cluster
name: "{{ Global.CLUSTER_ID }}"
- scopeRef:
apiVersion: core.oam.dev/v1alpha2
kind: Namespace
name: "{{ Global.NAMESPACE_ID }}"

0 comments on commit d476bf6

Please sign in to comment.