Skip to content

Commit 7516a86

Browse files
authored
Merge pull request #106 from GwonsooLee/new_version_release
New version release
2 parents 60d319b + 4f1aa2c commit 7516a86

File tree

129 files changed

+51433
-252
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+51433
-252
lines changed

Makefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ RELEASE_BUCKET ?= $(PROJECT)
2222
S3_RELEASE_PATH ?= s3://$(RELEASE_BUCKET)/releases/$(VERSION)
2323
S3_RELEASE_LATEST ?= s3://$(RELEASE_BUCKET)/releases/latest
2424
S3_BLEEDING_EDGE_LATEST ?= s3://$(RELEASE_BUCKET)/edge/latest
25+
S3_EXPERIMENTAL_LATEST ?= s3://$(RELEASE_BUCKET)/experimental/latest
2526

2627
GCP_ONLY ?= false
2728
GCP_PROJECT ?= goployer
@@ -99,7 +100,10 @@ $(BUILD_DIR):
99100
mkdir -p $(BUILD_DIR)
100101

101102
.PHONY: update-edge
102-
update-edge: format cross $(BUILD_DIR)/VERSION upload-only
103+
update-edge: format cross $(BUILD_DIR)/VERSION upload-edge-only
104+
105+
.PHONY: update-experimental
106+
update-experimental: format cross $(BUILD_DIR)/VERSION upload-experimental-only
103107

104108
.PHONY: release
105109
release: format cross $(BUILD_DIR)/VERSION upload-release-only
@@ -118,13 +122,20 @@ release-build: format cross
118122
aws s3 cp $(BUILD_DIR)/$(PROJECT)-* $(S3_RELEASE_PATH)/
119123
aws s3 cp -r $(S3_RELEASE_PATH)/* $(S3_RELEASE_LATEST)
120124

121-
.PHONY: upload-only
122-
upload-only: version
125+
.PHONY: upload-edge-only
126+
upload-edge-only: version
123127
aws s3 cp $(BUILD_DIR)/ $(S3_BLEEDING_EDGE_LATEST)/ --recursive --include "$(PROJECT)-*" --acl public-read
124128

125129
docker build --build-arg GOPLOYER_VERSION=edge --build-arg GOPLOYER_URL=https://goployer.s3.ap-northeast-2.amazonaws.com/edge/latest/goployer-linux-amd64 -t devopsart/goployer:edge deploy
126130
docker push devopsart/goployer:edge
127131

132+
.PHONY: upload-experimental-only
133+
upload-experimental-only: version
134+
aws s3 cp $(BUILD_DIR)/ $(S3_EXPERIMENTAL_LATEST)/ --recursive --include "$(PROJECT)-*" --acl public-read
135+
136+
docker build --build-arg GOPLOYER_VERSION=experimental --build-arg GOPLOYER_URL=https://goployer.s3.ap-northeast-2.amazonaws.com/experimental/latest/goployer-linux-amd64 -t devopsart/goployer:experimental deploy
137+
docker push devopsart/goployer:experimental
138+
128139
.PHONY: upload-release-only
129140
upload-release-only: version
130141
aws s3 cp $(BUILD_DIR)/ $(S3_RELEASE_PATH)/ --recursive --include "$(PROJECT)-*" --acl public-read

configs/hello.yaml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ stacks:
9797
# EBS Optimized
9898
ebs_optimized: true
9999

100+
# API Test Enabled
101+
api_test_enabled: true
102+
100103
# instance_market_options is for spot usage
101104
# You only can choose spot as market_type.
102105
# If you want to set customized stop options, then please write spot_options correctly.
@@ -120,9 +123,13 @@ stacks:
120123
- c5.large
121124
- c5.xlarge
122125

126+
# Minimum capacity of on demand base capacity
127+
# By default, this value will be 0.
128+
on_demand_base_capacity: 2
129+
123130
# Proportion of on-demand instances.
124131
# By default, this value will be 100 which means no spot instance.
125-
on_demand_percentage: 20
132+
on_demand_percentage: 50
126133

127134
# spot_allocation_strategy means in what strategy you want to allocate spot instances.
128135
# options could be either `lowest-price` or `capacity-optimized`.
@@ -132,7 +139,7 @@ stacks:
132139
# The number of spot instances pool.
133140
# This will be set among instance types in `override` fields
134141
# This will be valid only if the `spot_allocation_strategy` is low-price.
135-
spot_instance_pools: 3
142+
spot_instance_pools: 2
136143

137144
# Spot price.
138145
# By default, on-demand price will be automatically applied.
@@ -150,7 +157,7 @@ stacks:
150157
# capacity
151158
capacity:
152159
min: 1
153-
max: 2
160+
max: 1
154161
desired: 1
155162

156163
# autoscaling means scaling policy of autoscaling group
@@ -229,7 +236,7 @@ stacks:
229236
env: stage
230237
assume_role: ""
231238
replacement_type: BlueGreen
232-
iam_instance_profile:
239+
iam_instance_profile: 'app-hello-profile'
233240
tags:
234241
- test-stack=artd-with-classic-lb
235242
ebs_optimized: true
@@ -264,3 +271,17 @@ stacks:
264271
- ap-northeast-2b
265272
- ap-northeast-2c
266273

274+
api_test_template:
275+
name: api-test
276+
duration: 5s
277+
request_per_second: 10
278+
apis:
279+
- method: GET
280+
url: https://hello-wedapne2.weplydev.io
281+
- method: POST
282+
url: https://hello-wedapne2.weplydev.io/adduser
283+
body:
284+
- id=198355
285+
- username=Gwonsoo
286+
- test=test
287+

docs/content/en/schemas/schema.json

Lines changed: 104 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,86 @@
66
],
77
"type": "object",
88
"definitions": {
9+
"APIManifest": {
10+
"properties": {
11+
"body": {
12+
"items": {
13+
"type": "string",
14+
"default": "\"\""
15+
},
16+
"type": "array",
17+
"description": "list of body value as JSON format",
18+
"x-intellij-html-description": "list of body value as JSON format",
19+
"default": "[]"
20+
},
21+
"header": {
22+
"items": {
23+
"type": "string",
24+
"default": "\"\""
25+
},
26+
"type": "array",
27+
"description": "list of header value as JSON format",
28+
"x-intellij-html-description": "list of header value as JSON format",
29+
"default": "[]"
30+
},
31+
"method": {
32+
"type": "string",
33+
"description": "of API Call: [ GET, POST, PUT ... ]",
34+
"x-intellij-html-description": "of API Call: [ GET, POST, PUT ... ]",
35+
"default": "\"\""
36+
},
37+
"url": {
38+
"type": "string",
39+
"description": "Full URL of API",
40+
"x-intellij-html-description": "Full URL of API",
41+
"default": "\"\""
42+
}
43+
},
44+
"additionalProperties": false,
45+
"preferredOrder": [
46+
"method",
47+
"url",
48+
"body",
49+
"header"
50+
],
51+
"description": "Configuration of API test",
52+
"x-intellij-html-description": "Configuration of API test"
53+
},
54+
"APITestTemplate": {
55+
"properties": {
56+
"apis": {
57+
"items": {
58+
"$ref": "#/definitions/APIManifest"
59+
},
60+
"type": "array"
61+
},
62+
"duration": {
63+
"description": "of api test which means how long you want to test for API test",
64+
"x-intellij-html-description": "of api test which means how long you want to test for API test"
65+
},
66+
"name": {
67+
"type": "string",
68+
"description": "of test template",
69+
"x-intellij-html-description": "of test template",
70+
"default": "\"\""
71+
},
72+
"request_per_second": {
73+
"type": "integer",
74+
"description": "Request per second to call",
75+
"x-intellij-html-description": "Request per second to call",
76+
"default": "0"
77+
}
78+
},
79+
"additionalProperties": false,
80+
"preferredOrder": [
81+
"name",
82+
"duration",
83+
"request_per_second",
84+
"apis"
85+
],
86+
"description": "Templates for API Test",
87+
"x-intellij-html-description": "Templates for API Test"
88+
},
989
"AlarmConfigs": {
1090
"properties": {
1191
"alarm_actions": {
@@ -228,6 +308,12 @@
228308
"x-intellij-html-description": "Whether or not to use mixedInstancesPolicy",
229309
"default": "false"
230310
},
311+
"on_demand_base_capacity": {
312+
"type": "integer",
313+
"description": "Minimum capacity of on-demand instance",
314+
"x-intellij-html-description": "Minimum capacity of on-demand instance",
315+
"default": "0"
316+
},
231317
"on_demand_percentage": {
232318
"type": "integer",
233319
"description": "Percentage of On Demand instance",
@@ -267,9 +353,10 @@
267353
"preferredOrder": [
268354
"enabled",
269355
"override_instance_types",
356+
"on_demand_base_capacity",
270357
"on_demand_percentage",
271-
"spot_allocation_strategy",
272358
"spot_instance_pools",
359+
"spot_allocation_strategy",
273360
"spot_max_price"
274361
],
275362
"description": "of autoscaling group",
@@ -329,8 +416,8 @@
329416
},
330417
"region": {
331418
"type": "string",
332-
"description": "name",
333-
"x-intellij-html-description": "name",
419+
"description": "AWS region ID",
420+
"x-intellij-html-description": "AWS region ID",
334421
"default": "\"\""
335422
},
336423
"scheduled_actions": {
@@ -521,6 +608,12 @@
521608
"description": "CloudWatch alarm for autoscaling action",
522609
"x-intellij-html-description": "CloudWatch alarm for autoscaling action"
523610
},
611+
"api_test_enabled": {
612+
"type": "boolean",
613+
"description": "Whether or not to run API test",
614+
"x-intellij-html-description": "Whether or not to run API test",
615+
"default": "false"
616+
},
524617
"assume_role": {
525618
"type": "string",
526619
"description": "IAM Role ARN for assume role",
@@ -638,6 +731,7 @@
638731
"assume_role",
639732
"polling_interval",
640733
"ebs_optimized",
734+
"api_test_enabled",
641735
"instance_market_options",
642736
"mixed_instances_policy",
643737
"block_devices",
@@ -676,6 +770,11 @@
676770
},
677771
"YamlConfig": {
678772
"properties": {
773+
"api_test_template": {
774+
"$ref": "#/definitions/APITestTemplate",
775+
"description": "API Test configuration",
776+
"x-intellij-html-description": "API Test configuration"
777+
},
679778
"name": {
680779
"type": "string",
681780
"description": "Application Name",
@@ -720,7 +819,8 @@
720819
"userdata",
721820
"tags",
722821
"scheduled_actions",
723-
"stacks"
822+
"stacks",
823+
"api_test_template"
724824
],
725825
"description": "Yaml configuration from manifest file",
726826
"x-intellij-html-description": "Yaml configuration from manifest file"
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
name: hello
3+
userdata:
4+
type: local
5+
path: scripts/userdata.sh
6+
7+
autoscaling: &autoscaling_policy
8+
- name: scale_out
9+
adjustment_type: ChangeInCapacity
10+
scaling_adjustment: 1
11+
cooldown: 60
12+
- name: scale_in
13+
adjustment_type: ChangeInCapacity
14+
scaling_adjustment: -1
15+
cooldown: 180
16+
17+
alarms: &autoscaling_alarms
18+
- name: scale_out_on_util
19+
namespace: AWS/EC2
20+
metric: CPUUtilization
21+
statistic: Average
22+
comparison: GreaterThanOrEqualToThreshold
23+
threshold: 50
24+
period: 120
25+
evaluation_periods: 2
26+
alarm_actions:
27+
- scale_out
28+
- name: scale_in_on_util
29+
namespace: AWS/EC2
30+
metric: CPUUtilization
31+
statistic: Average
32+
comparison: LessThanOrEqualToThreshold
33+
threshold: 30
34+
period: 300
35+
evaluation_periods: 3
36+
alarm_actions:
37+
- scale_in
38+
39+
# Tags should be like "key=value"
40+
tags:
41+
- project=test
42+
- repo=hello-deploy
43+
44+
stacks:
45+
- stack: artd
46+
polling_interval: 30s
47+
account: dev
48+
env: dev
49+
assume_role: ""
50+
replacement_type: BlueGreen
51+
iam_instance_profile: 'app-hello-profile'
52+
ansible_tags: all
53+
ebs_optimized: true
54+
api_test_enabled: true
55+
instance_market_options:
56+
market_type: spot
57+
spot_options:
58+
block_duration_minutes: 180
59+
instance_interruption_behavior: terminate # terminate / stop / hibernate
60+
max_price: 0.3
61+
spot_instance_type: one-time # one-time or persistent
62+
block_devices:
63+
- device_name: /dev/xvda
64+
volume_size: 10
65+
volume_type: "gp2"
66+
- device_name: /dev/xvdb
67+
volume_type: "st1"
68+
volume_size: 500
69+
capacity:
70+
min: 1
71+
max: 2
72+
desired: 1
73+
autoscaling: *autoscaling_policy
74+
alarms: *autoscaling_alarms
75+
lifecycle_callbacks:
76+
pre_terminate_past_cluster:
77+
- service hello stop
78+
79+
regions:
80+
- region: ap-northeast-2
81+
instance_type: t3.medium
82+
ssh_key: test-master-key
83+
ami_id: ami-01288945bd24ed49a
84+
use_public_subnets: true
85+
vpc: vpc-artd_apnortheast2
86+
detailed_monitoring_enabled: false
87+
security_groups:
88+
- hello-artd_apnortheast2
89+
- default-artd_apnortheast2
90+
healthcheck_target_group: hello-artdapne2-ext
91+
availability_zones:
92+
- ap-northeast-2a
93+
- ap-northeast-2b
94+
- ap-northeast-2c
95+
target_groups:
96+
- hello-artdapne2-ext
97+
98+
99+
api_test_template:
100+
name: api-test
101+
duration: 5s
102+
request_per_second: 10
103+
apis:
104+
- method: GET
105+
url: https://example.com
106+
- method: POST
107+
url: https://example.com/post
108+
body:
109+
- id=1234
110+
- username=art
111+
- test=test

examples/scripts/userdata.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
sudo yum update
44
sudo amazon-linux-extras install nginx1.12
5-
sudo service nginx start
5+
sudo service nginx start

0 commit comments

Comments
 (0)