Skip to content

Commit a63ea4c

Browse files
authored
Merge pull request #1 from AutoSpotting/master
Update dependencies, including instance type data (LeanerCloud#308)
2 parents 122ab8f + 7647f58 commit a63ea4c

Some content is hidden

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

80 files changed

+15891
-5449
lines changed

.travis.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,19 @@
11
language: go
2-
32
go:
43
- 1.11
5-
64
sudo: required
7-
85
services:
96
- docker
10-
117
env:
12-
# options: nightly, custom, stable
13-
# default: custom
8+
matrix:
149
- FLAVOR=nightly
15-
10+
global:
11+
secure: E0H+b3i171uG8e/w6AVV9HDCCcoReTNlk2+YSENFYmnzxBmvQOo2YwI1jtBRgktG51yZZCzUJZnc0bkaghRT6nS6H8gVUN5GuZjMXdEwY3r+2Zqka6sS1ym+PK6JEA1bRjtX2iQFtk2V68gzUNvjKj8YB2zVJmX6St7tcQ9lBcluQ0xEFu7MZMknYrl9W2NnAhajt27D50uUELtSo3n61TEXXIvFRQyjHCMpGmqeZcXYtiSZAyZjraTsZr9/dngOSw0iExXDDa7cYPHHmmre+3aQUJ9AzotgB+C3+SJ+zOaOGPvVc4PS/G2Wj4siQ1Yv3nl9pvGgxeKtZgVQ92KN9ngdVtRs+XnwMC/x9VJN8vHHgI+coETZ9lhwhjeS8yFIXdBaktXz014ZVrVVpSB+BzoW4r6x/MlmZh0muJNME5OGFXbR0qFaaUB9WdQCst+MhVvSKiZ3Slmck4/3UcyAsuePj0sF1Z/yv9YJR84NTEUdif/PQnBDC1ulhXAIhZ+gm7ZOMZXRW9U7YZlHnFpBg8KoVETlnkT6AjKZ5jy+gz4CgisN2H7OuyjVQm5kIEXPo8ORJqYHPM3tu9HVsCHb6Pm+y9pec/1YXSKtmFbJiYeAmbz3Lp8vVUX5tOo24o0hCyU7qA/ypCUxRoHrHHC+c9u8nQDWGcQBD0azp+dcy2s=
1612
script:
17-
- make travisci
18-
- make terraform-test
19-
13+
- make travisci
14+
- make terraform-test
2015
after_success:
21-
- curl --request POST "https://goreportcard.com/checks" --data "repo=github.com/cristim/autospotting"
22-
16+
- curl --request POST "https://goreportcard.com/checks" --data "repo=github.com/AutoSpotting/AutoSpotting"
2317
deploy:
2418
provider: s3
2519
access_key_id: AKIAJLFCT4RDMFFFREPA
@@ -30,17 +24,14 @@ deploy:
3024
skip_cleanup: true
3125
acl: public_read
3226
on:
33-
repo: cristim/autospotting
34-
27+
repo: AutoSpotting/AutoSpotting
3528
notifications:
3629
webhooks:
3730
urls:
38-
- https://webhooks.gitter.im/e/73346abd21785c9a053c
39-
# options: [always|never|change] default: always
31+
- https://webhooks.gitter.im/e/73346abd21785c9a053c
4032
on_success: change
4133
on_failure: always
4234
on_start: never
43-
4435
addons:
4536
code_climate:
4637
repo_token:

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Contribution guidelines #
22

3-
[![Chat on Gitter](https://badges.gitter.im/cristim/autospotting.svg)](https://gitter.im/cristim/autospotting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
3+
[![Chat on Gitter](https://badges.gitter.im/AutoSpotting/AutoSpotting.svg)](https://gitter.im/AutoSpotting/AutoSpotting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
44

55
The usual GitHub contribution model applies, but if you would like to [raise an
6-
issue](https://github.com/cristim/autospotting/issues/new) or start working on a
7-
[pull request](https://github.com/cristim/autospotting/pulls), please get in
8-
touch on [gitter](https://gitter.im/cristim/autospotting) to discuss it first so
6+
issue](https://github.com/AutoSpotting/AutoSpotting/issues/new) or start working on a
7+
[pull request](https://github.com/AutoSpotting/AutoSpotting/pulls), please get in
8+
touch on [gitter](https://gitter.im/AutoSpotting/AutoSpotting) to discuss it first so
99
we make sure everything is clear and that nobody else is already working on it.
1010

1111
Any random questions are also better asked there.

CUSTOM_BUILDS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ your CloudFormation or Terraform stack to use those new binaries.
3939
1. Run the following command to install the AutoSpotting project into your
4040
GOPATH directory:
4141

42-
`go get github.com/cristim/autospotting`
42+
`go get github.com/AutoSpotting/AutoSpotting`
4343

4444
This downloads the source from GitHub, pulls in all necessary dependencies,
4545
builds it for local execution and deploys the binary into the golang binary
4646
directory which you may also want to append to your PATH.
4747

4848
1. Navigate to the root of the AutoSpotting repository:
4949

50-
`cd $GOPATH/src/github.com/cristim/autospotting`
50+
`cd $GOPATH/src/github.com/AutoSpotting/AutoSpotting`
5151

5252
1. (Optional) You may want to make a minor change to the source code so you can
5353
tell when the tool is running your own custom-built version. If so, add a
@@ -159,6 +159,6 @@ This also accepts all the autospotting command-line arguments, including `-help`
159159
which explains all the available options.
160160

161161
Pre-built Docker images for the latest builds are also available on Dockerhub at
162-
[cristim/autospotting](https://hub.docker.com/r/cristim/autospotting/)
162+
[AutoSpotting/AutoSpotting](https://hub.docker.com/r/AutoSpotting/AutoSpotting/)
163163

164164
[Back to the main Readme](./README.md)

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
FROM golang:1.11-alpine as golang
22
RUN apk add -U --no-cache ca-certificates git make
3-
RUN go get -v github.com/cristim/autospotting/...
4-
WORKDIR /go/src/github.com/cristim/autospotting/
3+
RUN go get -v github.com/AutoSpotting/AutoSpotting/...
4+
WORKDIR /go/src/github.com/AutoSpotting/AutoSpotting/
55
RUN FLAVOR=nightly CGO_ENABLED=0 make
66

77
FROM scratch
88
WORKDIR /
99
COPY LICENSE BINARY_LICENSE /
10-
COPY --from=golang /go/src/github.com/cristim/autospotting/autospotting .
10+
COPY --from=golang /go/src/github.com/AutoSpotting/AutoSpotting/autospotting .
1111
COPY --from=golang /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
1212
ENTRYPOINT ["./autospotting"]

FAQ.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ after spot instances are terminated and on-demand instances are launched again
545545
in the group.
546546

547547
This behavior may be changed once implementing
548-
[#119](https://github.com/cristim/autospotting/issues/119), in which we may
548+
[#119](https://github.com/AutoSpotting/AutoSpotting/issues/119), in which we may
549549
implement a strategy bidding closer to the current spot price in order to avoid
550550
running that spot instance after significant spot price increases.
551551

@@ -559,9 +559,9 @@ Have a look at the logs for more details.
559559
Spot instances may fail to launch for a number of reasons, such as market
560560
conditions that manifest in high prices across all the compatible instance
561561
types, but also known bugs or limitations in the current implementation, such as
562-
[#105](https://github.com/cristim/autospotting/issues/105),
563-
[#106](https://github.com/cristim/autospotting/issues/106) and
564-
[110](https://github.com/cristim/autospotting/issues/110), which would need to
562+
[#105](https://github.com/AutoSpotting/AutoSpotting/issues/105),
563+
[#106](https://github.com/AutoSpotting/AutoSpotting/issues/106) and
564+
[110](https://github.com/AutoSpotting/AutoSpotting/issues/110), which would need to
565565
be fixed or simply implemented. If you are impacted by such issues please
566566
consider [contributing](CONTRIBUTING.md) a fix.
567567

@@ -593,7 +593,7 @@ actions against your instances and autoscaling groups.
593593
This configuration was carefully crafted to contain the minimum amount of
594594
permissions needed for the instance replacement and logging its actions. The
595595
full list can be seen in the Cloudformation stack
596-
[template](https://github.com/cristim/autospotting/blob/master/cloudformation/stacks/AutoSpotting/template.yaml#L199),
596+
[template](https://github.com/AutoSpotting/AutoSpotting/blob/master/cloudformation/stacks/AutoSpotting/template.yaml#L199),
597597
but it basically boils down to the following:
598598

599599
- describing the resources you have in order to decide what needs to be done

Gopkg.lock

Lines changed: 6 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ html-cover: test ## Display coverage
100100
.PHONY: html-cover
101101

102102
travisci-cover: html-cover ## Test & generate coverage in the TravisCI format, fails unless executed from TravisCI
103-
@goveralls -coverprofile=$(COVER_PROFILE) -service=travis-ci
103+
@goveralls -coverprofile=$(COVER_PROFILE) -service=travis-ci -repotoken=$(COVERALLS_TOKEN)
104104
.PHONY: travisci-cover
105105

106106
travisci-checks: fmt-check vet-check lint ## Pass fmt / vet & lint format

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
<img src="logo.png" width="150" align="right">
66

7-
[![BuildStatus](https://travis-ci.org/cristim/autospotting.svg?branch=master)](https://travis-ci.org/cristim/autospotting)
8-
[![GoReportCard](https://goreportcard.com/badge/github.com/cristim/autospotting)](https://goreportcard.com/report/github.com/cristim/autospotting)
9-
[![CoverageStatus](https://coveralls.io/repos/github/cristim/autospotting/badge.svg?branch=master)](https://coveralls.io/github/cristim/autospotting?branch=master)
10-
[![CodeClimate](https://codeclimate.com/github/cristim/autospotting/badges/gpa.svg)](https://codeclimate.com/github/cristim/autospotting)
11-
[![IssueCount](https://codeclimate.com/github/cristim/autospotting/badges/issue_count.svg)](https://codeclimate.com/github/cristim/autospotting)
12-
[![ChatOnGitter](https://badges.gitter.im/cristim/autospotting.svg)](https://gitter.im/cristim/autospotting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
13-
[![Open Source Helpers](https://www.codetriage.com/cristim/autospotting/badges/users.svg)](https://www.codetriage.com/cristim/autospotting)
7+
[![BuildStatus](https://travis-ci.org/AutoSpotting/AutoSpotting.svg?branch=master)](https://travis-ci.org/AutoSpotting/AutoSpotting)
8+
[![GoReportCard](https://goreportcard.com/badge/github.com/AutoSpotting/AutoSpotting)](https://goreportcard.com/report/github.com/AutoSpotting/AutoSpotting)
9+
[![CoverageStatus](https://coveralls.io/repos/github/AutoSpotting/AutoSpotting/badge.svg?branch=master)](https://coveralls.io/github/AutoSpotting/AutoSpotting?branch=master)
10+
[![CodeClimate](https://codeclimate.com/github/AutoSpotting/AutoSpotting/badges/gpa.svg)](https://codeclimate.com/github/AutoSpotting/AutoSpotting)
11+
[![IssueCount](https://codeclimate.com/github/AutoSpotting/AutoSpotting/badges/issue_count.svg)](https://codeclimate.com/github/AutoSpotting/AutoSpotting)
12+
[![ChatOnGitter](https://badges.gitter.im/AutoSpotting/AutoSpotting.svg)](https://gitter.im/AutoSpotting/AutoSpotting?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
13+
[![Open Source Helpers](https://www.codetriage.com/AutoSpotting/AutoSpotting/badges/users.svg)](https://www.codetriage.com/AutoSpotting/AutoSpotting)
1414
[![Patreon](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/cristim/overview)
1515

1616
A simple and easy to use tool designed to significantly lower your Amazon AWS
@@ -108,7 +108,7 @@ and we'll do our best to answer them either there or on Gitter.
108108
## Getting Started ##
109109

110110
Just like in the above animation, it's as easy as launching a CloudFormation (or
111-
[Terraform](https://github.com/cristim/autospotting/tree/master/terraform))
111+
[Terraform](https://github.com/AutoSpotting/AutoSpotting/tree/master/terraform))
112112
stack and setting the (configurable) `spot-enabled` tag on the AutoScaling
113113
groups where you want it enabled to `true`.
114114

@@ -134,7 +134,7 @@ For more detailed information you can read this [document](START.md)
134134
## Support ##
135135

136136
Community support is available on the
137-
[gitter](https://gitter.im/cristim/autospotting) chat room, where the main
137+
[gitter](https://gitter.im/AutoSpotting/AutoSpotting) chat room, where the main
138138
authors and other users are likely to help you solve issues with these official
139139
binaries.
140140

@@ -150,7 +150,7 @@ appreciate the work they put in it, please consider contributing to the
150150
development effort as well.
151151

152152
You can just try it out and give
153-
[feedback](https://gitter.im/cristim/autospotting), report issues, improve the
153+
[feedback](https://gitter.im/AutoSpotting/AutoSpotting), report issues, improve the
154154
documentation, write some code or assign a developer to work on it, or even just
155155
spread the word among your peers who might be interested in it. Any amount of
156156
help would be greatly appreciated and would make a huge difference to the

START.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,14 +107,14 @@ on your machine.
107107
#### Default install ####
108108

109109
Pre-built binaries easier to install are available when using the Terraform
110-
[module](https://registry.terraform.io/modules/cristim/autospotting/aws)
110+
[module](https://registry.terraform.io/modules/AutoSpotting/AutoSpotting/aws)
111111
available from the Terraform Registry.
112112

113113
Copy and paste the below snippet into your Terraform configuration:
114114

115115
```hcl
116116
module "autospotting" {
117-
source = "cristim/autospotting/aws"
117+
source = "AutoSpotting/AutoSpotting/aws"
118118
version = "0.0.9" # this version is subject to change
119119
}
120120
```
@@ -172,7 +172,7 @@ use the module directly:
172172

173173
```hcl
174174
module "autospotting" {
175-
source = "github.com/cristim/autospotting//terraform/autospotting"
175+
source = "github.com/AutoSpotting/AutoSpotting//terraform/autospotting"
176176
177177
178178
autospotting_disallowed_instance_types = "t2.*"
@@ -204,7 +204,7 @@ in S3:
204204

205205
```hcl
206206
module "autospotting" {
207-
source = "github.com/cristim/autospotting//terraform/autospotting"
207+
source = "github.com/AutoSpotting/AutoSpotting//terraform/autospotting"
208208
209209
lambda_s3_bucket = "lambda-releases"
210210
lambda_s3_key = "autospotting.zip"
@@ -219,7 +219,7 @@ Kubernetes cron job, instead of running it in AWS Lambda.
219219
<!-- markdownlint-disable MD013 -->
220220

221221
``` shell
222-
curl https://raw.githubusercontent.com/cristim/autospotting/master/kubernetes/autospotting-cron.yaml.example > autospotting-cron.yaml
222+
curl https://raw.githubusercontent.com/AutoSpotting/AutoSpotting/master/kubernetes/autospotting-cron.yaml.example > autospotting-cron.yaml
223223
```
224224

225225
<!-- markdownlint-enable MD013 -->
@@ -464,7 +464,7 @@ The full list of the objects available in the bucket can be seen
464464
[here](http://s3.amazonaws.com/cloudprowess/index.html).
465465

466466
The full list of TravisCI builds and their respective git commits can be seen on
467-
the Travis CI [builds page](https://travis-ci.org/cristim/autospotting/builds)
467+
the Travis CI [builds page](https://travis-ci.org/AutoSpotting/AutoSpotting/builds)
468468

469469
### Compatibility notices ###
470470

TECHNICAL_DETAILS.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
## Summary of supported features & options ##
66

7-
| Option | Status | [Override using ASG tags](https://github.com/cristim/autospotting/blob/master/core/autoscaling.go#L16) |
7+
| Option | Status | [Override using ASG tags](https://github.com/AutoSpotting/AutoSpotting/blob/master/core/autoscaling.go#L16) |
88
| ------- | :----: | :-------------------: |
99
| Run on multiple regions | :white_check_mark: (default: all)| :heavy_minus_sign: |
10-
| [Keep a fixed minimum percentage of on-demand](https://github.com/cristim/autospotting/blob/master/START.md#minimum-on-demand-configuration) | :white_check_mark: (default: 0%) | :white_check_mark: |
11-
| [Keep a fixed minimum number of on-demand](https://github.com/cristim/autospotting/blob/master/START.md#minimum-on-demand-configuration) | :white_check_mark: (default: 0) | :white_check_mark: |
10+
| [Keep a fixed minimum percentage of on-demand](https://github.com/AutoSpotting/AutoSpotting/blob/master/START.md#minimum-on-demand-configuration) | :white_check_mark: (default: 0%) | :white_check_mark: |
11+
| [Keep a fixed minimum number of on-demand](https://github.com/AutoSpotting/AutoSpotting/blob/master/START.md#minimum-on-demand-configuration) | :white_check_mark: (default: 0) | :white_check_mark: |
1212
| Bid at a certain percentage of the on-demand price | :white_check_mark: (default: 100%) | :white_check_mark: |
1313
| Can bid the current spot price plus a certain percentage | :white_check_mark: | :white_check_mark: |
1414
| Automatically determine the cheapest compatible instance type | :white_check_mark: (default) | :white_check_mark: |
@@ -21,17 +21,17 @@
2121

2222
For the options not directly linked to any specific part of the doc, please
2323
check the
24-
[configuration](https://github.com/cristim/autospotting/blob/master/START.md#configuration-of-autospotting) page.
24+
[configuration](https://github.com/AutoSpotting/AutoSpotting/blob/master/START.md#configuration-of-autospotting) page.
2525

2626
| Feature | Status |
2727
| ------- | :----: |
28-
| [Easy installation via Cloudformation](https://github.com/cristim/autospotting/blob/master/START.md#install-via-cloudformation) | :white_check_mark: |
29-
| [Easy installation via Terraform](https://github.com/cristim/autospotting/blob/master/START.md#install-via-terraform) | :white_check_mark: |
30-
| [Available as Docker container image](https://hub.docker.com/r/cristim/autospotting/) | :white_check_mark: :wrench: |
28+
| [Easy installation via Cloudformation](https://github.com/AutoSpotting/AutoSpotting/blob/master/START.md#install-via-cloudformation) | :white_check_mark: |
29+
| [Easy installation via Terraform](https://github.com/AutoSpotting/AutoSpotting/blob/master/START.md#install-via-terraform) | :white_check_mark: |
30+
| [Available as Docker container image](https://hub.docker.com/r/AutoSpotting/AutoSpotting/) | :white_check_mark: :wrench: |
3131
| [Works with Code Deploy](CODEDEPLOY.md) | :white_check_mark: :wrench: |
32-
| [Works with Elastic Beanstalk](https://github.com/cristim/autospotting/blob/053135e97082511fb99b689dce4a7a7830f3327c/START.md#for-elastic-beanstalk) | :white_check_mark: |
32+
| [Works with Elastic Beanstalk](https://github.com/AutoSpotting/AutoSpotting/blob/053135e97082511fb99b689dce4a7a7830f3327c/START.md#for-elastic-beanstalk) | :white_check_mark: |
3333
| Support AWS VPC| :white_check_mark: |
34-
| Support AWS EC2Classic|[:beetle:](https://github.com/cristim/autospotting/issues/48) :pencil: |
34+
| Support AWS EC2Classic|[:beetle:](https://github.com/AutoSpotting/AutoSpotting/issues/48) :pencil: |
3535
| Support AWS DefaultVPC| :white_check_mark: |
3636
| [Rancher compliance](http://rancher.com/reducing-aws-spend/) | :white_check_mark: |
3737
| Lambda X-Ray support | :x: |
@@ -55,7 +55,7 @@ check the
5555

5656
Some of them can be clicked for more information, you can see if you hover them
5757
with your mouse pointer, but if you have any questions you can always get in
58-
touch on [Gitter](https://gitter.im/cristim/autospotting).
58+
touch on [Gitter](https://gitter.im/AutoSpotting/AutoSpotting).
5959

6060
## Features and Benefits ##
6161

autospotting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"log"
66
"os"
77

8+
"github.com/AutoSpotting/AutoSpotting/core"
89
"github.com/aws/aws-lambda-go/events"
910
"github.com/aws/aws-lambda-go/lambda"
1011
"github.com/aws/aws-sdk-go/aws/endpoints"
11-
"github.com/cristim/autospotting/core"
1212
"github.com/cristim/ec2-instances-info"
1313
"github.com/namsral/flag"
1414
)

cloudformation/stacks/AutoSpotting/template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"Path to the Lambda function zip file inside the S3 bucket. Can be used
7575
to update to a more recent version, such as
7676
'nightly/lambda_build_57.zip'. Build numbers can be taken from TravisCI:
77-
https://travis-ci.org/cristim/autospotting/builds"
77+
https://travis-ci.org/AutoSpotting/AutoSpotting/builds"
7878
Type: "String"
7979
LogRetentionPeriod:
8080
Default: "7"

kubernetes/autospotting-cron.yaml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
restartPolicy: Never
1616
containers:
1717
- name: autospotting-cron-job
18-
image: cristim/autospotting:latest
18+
image: AutoSpotting/AutoSpotting:latest
1919
# Environment variables for the AutoSpotting pod
2020
# Feel free to configure them to suit your needs
2121
env:

vendor/github.com/aws/aws-lambda-go/events/iot_button.go

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)