Permalink
Browse files

Supergiant Alpha Initial Push

This push is the initial push for Supergiant Alpha, After this point,
master will be considered unstable, and releases will be created on
version branches.
  • Loading branch information...
gopherstein committed Sep 14, 2017
1 parent 337443a commit 2c2b6012ec8c4e62a79dc00e949155292ebf4f11
Showing 418 changed files with 40,819 additions and 146 deletions.
View
@@ -7,3 +7,12 @@ config/config.json
/bindata/
/build/dist/
/data/
/dist/
/build/docker/ui/linux-amd64/supergiant-ui-linux-amd64
/build/docker/ui/darwin-amd64/supergiant-ui-darwin-10.6-amd64
/build/docker/ui/windows-amd64/supergiant-ui-windows-4.0-amd64.exe
/build/docker/ui/linux-arm64/supergiant-ui-linux-arm64
/build/docker/api/linux-amd64/supergiant-server-linux-amd64
/build/docker/api/darwin-amd64/supergiant-server-darwin-10.6-amd64
/build/docker/api/windows-amd64/supergiant-server-windows-4.0-amd64.exe
/build/docker/api/linux-arm64/supergiant-server-linux-arm64
View
@@ -27,26 +27,35 @@ install:
- go get github.com/tcnksm/ghr
- go get github.com/karalabe/xgo
- go get -u github.com/jteeuwen/go-bindata/...
- npm install -g npm@5.3.0
- npm install -g @angular/cli@1.3.2
script:
# Test
# - govendor test +local (NOTE not needed with coverage line below)
# Compile assets
- go-bindata -pkg bindata -o bindata/bindata.go config/providers/... ui/assets/... ui/views/...
- cd cmd/ui/assets
- npm --version
- npm install
- ng build --aot --prod
- cd ../../../
- go-bindata -pkg ui -o bindata/ui/bindata.go cmd/ui/assets/dist/...
# Coverage
- go list -f "{{ if or (len .TestGoFiles) (len .XTestGoFiles) }}\"go test -covermode=count -coverpkg $(go list ./pkg/... | awk -v ORS=, '{ print $1 }' | sed 's/,$//') -coverprofile={{ .Dir }}/.coverprofile {{ .ImportPath }}\"{{ end }}" ./... | xargs -L 1 sh -c
- go list -f "{{ if or (len .TestGoFiles) (len .XTestGoFiles) }}\"go test -v -covermode=count -coverpkg $(go list ./pkg/... | awk -v ORS=, '{ print $1 }' | sed 's/,$//') -coverprofile={{ .Dir }}/.coverprofile {{ .ImportPath }}\"{{ end }}" ./... | xargs -L 1 sh -c
- cat $(find . -regex '.*/.coverprofile') > .coverprofile
- sed -i.bak '/^mode:\ count$/d' .coverprofile
- echo 'mode':' count' | cat - .coverprofile > /tmp/out && mv /tmp/out .coverprofile
- goveralls -coverprofile=.coverprofile -service=travis-ci
# Cross compile
- BUILD_TARGETS=windows/386,windows/amd64,darwin/386,darwin/amd64,linux/386,linux/amd64
- BUILD_TARGETS=windows/386,windows/amd64,darwin/386,darwin/amd64,linux/386,linux/amd64,linux/arm64
- LDFLAGS="-X main.version=$(git describe --tags)"
- xgo -ldflags "$LDFLAGS" -go 1.7.1 --targets=$BUILD_TARGETS -out dist/supergiant-server ./cmd/server
- xgo -ldflags "$LDFLAGS" -go 1.7.1 --targets=$BUILD_TARGETS -out dist/supergiant-cli ./cmd/cli
- xgo -ldflags "$LDFLAGS" -go 1.7.1 --targets=$BUILD_TARGETS -out dist/supergiant-ui ./cmd/ui
- travis_wait 60 build/travis_build.sh
View
@@ -18,8 +18,7 @@
"ami_name": "supergiant {{user `version`}}",
"security_group_id": "sg-756a960f"
}],
"provisioners": [
{
"provisioners": [{
"type": "file",
"source": "build/sgboot",
"destination": "~/sgboot"
@@ -35,26 +34,27 @@
"destination": "~/supergiant-server.conf"
},
{
"type": "shell",
"inline_shebang": "/bin/bash",
"inline": [
"sleep 30",
"sudo sh -c 'echo \"deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main\" >> /etc/apt/sources.list.d/pgdg.list'",
"wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -",
"sudo apt-get update",
"sudo apt-get -y upgrade",
"sudo apt-get install -y postgresql postgresql-contrib",
"sudo chmod 755 ~/supergiant",
"sudo mkdir /supergiant",
"sudo cp ~/supergiant /supergiant/supergiant",
"sudo echo {{user `version`}} > ~/version",
"sudo cp ~/version /supergiant/version",
"sudo cp ~/supergiant-server.conf /etc/init/supergiant-server.conf",
"sudo cp ~/sgboot /etc/init.d/sgboot",
"sudo chmod 755 /etc/init.d/sgboot",
"sudo ln -s /etc/init/supergiant-server.conf /etc/init.d/supergiant-server",
"sudo -u postgres psql -U postgres -d postgres -c \"alter user postgres with password 'postgres';\"",
"sudo -u postgres psql --command 'CREATE DATABASE supergiant;'"
"type": "shell",
"inline_shebang": "/bin/bash",
"inline": [
"sleep 30",
"sudo sh -c 'echo \"deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main\" >> /etc/apt/sources.list.d/pgdg.list'",
"wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -",
"sudo apt-get update",
"sudo apt-get -y upgrade",
"sudo apt-get install -y postgresql postgresql-contrib",
"sudo chmod 755 ~/supergiant",
"sudo mkdir /supergiant",
"sudo cp ~/supergiant /supergiant/supergiant",
"sudo echo {{user `version`}} > ~/version",
"sudo cp ~/version /supergiant/version",
"sudo cp ~/supergiant-server.conf /etc/init/supergiant-server.conf",
"sudo cp ~/sgboot /etc/init.d/sgboot",
"sudo chmod 755 /etc/init.d/sgboot",
"sudo ln -s /etc/init/supergiant-server.conf /etc/init.d/supergiant-server",
"sudo -u postgres psql -U postgres -d postgres -c \"alter user postgres with password 'postgres';\"",
"sudo -u postgres psql --command 'CREATE DATABASE supergiant;'"
]
}
]
}]
}
@@ -0,0 +1,3 @@
from scratch
COPY ./supergiant-server-darwin-10.6-amd64 /supergiant-server
CMD ["/supergiant-server"]
@@ -0,0 +1,19 @@
from alpine
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
ENV GLIBC_VERSION 2.25-r0
# Download and install glibc
RUN apk add --update curl && \
curl -Lo /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub && \
curl -Lo glibc.apk "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk" && \
curl -Lo glibc-bin.apk "https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-bin-${GLIBC_VERSION}.apk" && \
apk add glibc-bin.apk glibc.apk && \
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib && \
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf && \
apk del curl && \
rm -rf glibc.apk glibc-bin.apk /var/cache/apk/*
RUN apk add --no-cache ca-certificates
ADD ./supergiant-server-linux-amd64 /supergiant-api
ADD ./config.json /
CMD ["/supergiant-api"]
@@ -0,0 +1,91 @@
{
"sqlite_file": "tmp/development.db",
"ui_enabled": true,
"capacity_service_enabled": true,
"publish_host": "localhost",
"http_port": "8080",
"log_file": "tmp/development.log",
"log_level": "debug",
"node_sizes": {
"aws": [
{"name": "t2.nano", "ram_gib": 0.5, "cpu_cores": 1},
{"name": "t2.micro", "ram_gib": 1, "cpu_cores": 1},
{"name": "t1.micro", "ram_gib": 0.613, "cpu_cores": 1},
{"name": "t2.small", "ram_gib": 2, "cpu_cores": 1},
{"name": "m1.small", "ram_gib": 1.7, "cpu_cores": 1},
{"name": "t2.medium", "ram_gib": 4, "cpu_cores": 2},
{"name": "m3.medium", "ram_gib": 3.75, "cpu_cores": 1},
{"name": "m1.medium", "ram_gib": 3.75, "cpu_cores": 1},
{"name": "t2.large", "ram_gib": 8, "cpu_cores": 2},
{"name": "c3.large", "ram_gib": 3.75, "cpu_cores": 2},
{"name": "c4.large", "ram_gib": 3.75, "cpu_cores": 2},
{"name": "m4.large", "ram_gib": 8, "cpu_cores": 2},
{"name": "c1.medium", "ram_gib": 1.7, "cpu_cores": 2},
{"name": "m3.large", "ram_gib": 7.5, "cpu_cores": 2},
{"name": "r3.large", "ram_gib": 15.25, "cpu_cores": 2},
{"name": "m1.large", "ram_gib": 7.5, "cpu_cores": 2},
{"name": "c4.xlarge", "ram_gib": 7.5, "cpu_cores": 4},
{"name": "c3.xlarge", "ram_gib": 7.5, "cpu_cores": 4},
{"name": "m4.xlarge", "ram_gib": 16, "cpu_cores": 4},
{"name": "m2.xlarge", "ram_gib": 17.1, "cpu_cores": 2},
{"name": "m3.xlarge", "ram_gib": 15, "cpu_cores": 4},
{"name": "r3.xlarge", "ram_gib": 30.5, "cpu_cores": 4},
{"name": "m1.xlarge", "ram_gib": 15, "cpu_cores": 4},
{"name": "c4.2xlarge", "ram_gib": 15, "cpu_cores": 8},
{"name": "c3.2xlarge", "ram_gib": 15, "cpu_cores": 8},
{"name": "m4.2xlarge", "ram_gib": 32, "cpu_cores": 8},
{"name": "m2.2xlarge", "ram_gib": 34.2, "cpu_cores": 4},
{"name": "c1.xlarge", "ram_gib": 7, "cpu_cores": 8},
{"name": "m3.2xlarge", "ram_gib": 30, "cpu_cores": 8},
{"name": "g2.2xlarge", "ram_gib": 15, "cpu_cores": 8},
{"name": "r3.2xlarge", "ram_gib": 61, "cpu_cores": 8},
{"name": "d2.xlarge", "ram_gib": 30.5, "cpu_cores": 4},
{"name": "c4.4xlarge", "ram_gib": 30, "cpu_cores": 16},
{"name": "c3.4xlarge", "ram_gib": 30, "cpu_cores": 16},
{"name": "i2.xlarge", "ram_gib": 30.5, "cpu_cores": 4},
{"name": "m4.4xlarge", "ram_gib": 64, "cpu_cores": 16},
{"name": "m2.4xlarge", "ram_gib": 68.4, "cpu_cores": 8},
{"name": "r3.4xlarge", "ram_gib": 122, "cpu_cores": 16},
{"name": "d2.2xlarge", "ram_gib": 61, "cpu_cores": 8},
{"name": "c4.8xlarge", "ram_gib": 60, "cpu_cores": 36},
{"name": "c3.8xlarge", "ram_gib": 60, "cpu_cores": 32},
{"name": "i2.2xlarge", "ram_gib": 61, "cpu_cores": 8},
{"name": "cc2.8xlarge", "ram_gib": 60.5, "cpu_cores": 32},
{"name": "cg1.4xlarge", "ram_gib": 22.5, "cpu_cores": 16},
{"name": "m4.10xlarge", "ram_gib": 160, "cpu_cores": 40},
{"name": "g2.8xlarge", "ram_gib": 60, "cpu_cores": 32},
{"name": "r3.8xlarge", "ram_gib": 244, "cpu_cores": 32},
{"name": "d2.4xlarge", "ram_gib": 122, "cpu_cores": 16},
{"name": "hi1.4xlarge", "ram_gib": 60.5, "cpu_cores": 16},
{"name": "i2.4xlarge", "ram_gib": 122, "cpu_cores": 16},
{"name": "cr1.8xlarge", "ram_gib": 244, "cpu_cores": 32},
{"name": "hs1.8xlarge", "ram_gib": 117, "cpu_cores": 16},
{"name": "d2.8xlarge", "ram_gib": 244, "cpu_cores": 36},
{"name": "i2.8xlarge", "ram_gib": 244, "cpu_cores": 32}
],
"digitalocean": [
{"name": "512mb", "ram_gib": 0.5, "cpu_cores": 1},
{"name": "1gb", "ram_gib": 1, "cpu_cores": 1},
{"name": "2gb", "ram_gib": 2, "cpu_cores": 2},
{"name": "4gb", "ram_gib": 4, "cpu_cores": 2},
{"name": "8gb", "ram_gib": 8, "cpu_cores": 4},
{"name": "16gb", "ram_gib": 16, "cpu_cores": 8},
{"name": "32gb", "ram_gib": 32, "cpu_cores": 12},
{"name": "48gb", "ram_gib": 48, "cpu_cores": 16},
{"name": "64gb", "ram_gib": 64, "cpu_cores": 20}
],
"gce": [
{"name": "n1-standard-1", "ram_gib": 3.75, "cpu_cores": 1},
{"name": "n1-standard-2", "ram_gib": 7.5, "cpu_cores": 2},
{"name": "n1-standard-4", "ram_gib": 15, "cpu_cores": 4},
{"name": "n1-standard-8", "ram_gib": 30, "cpu_cores": 8}
],
"packet": [
{"name": "Type 0", "ram_gib": 8, "cpu_cores": 4},
{"name": "Type 1", "ram_gib": 32, "cpu_cores": 4},
{"name": "Type 2", "ram_gib": 256, "cpu_cores": 24},
{"name": "Type 2A", "ram_gib": 128, "cpu_cores": 96},
{"name": "Type 3", "ram_gib": 128, "cpu_cores": 16}
]
}
}
@@ -0,0 +1,3 @@
from scratch
COPY ./supergiant-server-linux-arm64 /supergiant-server
CMD ["/supergiant-server"]
@@ -0,0 +1,3 @@
from scratch
COPY ./supergiant-server-windows-4.0-amd64.exe /supergiant-server.exe
CMD ["/supergiant-server"]
@@ -0,0 +1,3 @@
from alpine
COPY ./supergiant-ui-darwin-10.6-amd64 /supergiant-ui
CMD ["/supergiant-ui"]
@@ -0,0 +1,4 @@
from alpine
RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
ADD ./supergiant-ui-linux-amd64 /supergiant-ui
CMD ["/supergiant-ui"]
@@ -0,0 +1,3 @@
from scratch
COPY ./supergiant-ui-linux-arm64 /supergiant-ui
CMD ["/supergiant-ui"]
@@ -0,0 +1,3 @@
from scratch
COPY ./supergiant-ui-windows-4.0-amd64.exe /supergiant-ui.exe
CMD ["/supergiant-ui"]
View
@@ -4,11 +4,39 @@
TAG=${TRAVIS_BRANCH:-unstable}
echo "Tag Name: ${TAG}"
if [[ "$TAG" =~ ^v[0-100]. ]]; then
echo "global deploy"
./packer build build/build_release.json
else
echo "private unstable"
# ./packer build build/build_branch.json
docker login -u $DOCKER_USER -p $DOCKER_PASS
## UI Docker Build
REPO=supergiant/supergiant-ui
cp dist/supergiant-ui-linux-amd64 build/docker/ui/linux-amd64/
cp dist/supergiant-ui-darwin-10.6-amd64 build/docker/ui/darwin-amd64/
cp dist/supergiant-ui-windows-4.0-amd64.exe build/docker/ui/windows-amd64/
cp dist/supergiant-ui-linux-arm64 build/docker/ui/linux-arm64/
docker build -t $REPO:$TAG-linux-x64 build/docker/ui/linux-amd64/
docker build -t $REPO:$TAG-darwin-x64 build/docker/ui/linux-amd64/
docker build -t $REPO:$TAG-windows-x64 build/docker/ui/linux-amd64/
docker build -t $REPO:$TAG-linux-arm64 build/docker/ui/linux-arm64/
docker push $REPO
## API Docker Build
REPO=supergiant/supergiant-api
cp dist/supergiant-server-linux-amd64 build/docker/api/linux-amd64/
cp dist/supergiant-server-darwin-10.6-amd64 build/docker/api/darwin-amd64/
cp dist/supergiant-server-windows-4.0-amd64.exe build/docker/api/windows-amd64/
cp dist/supergiant-server-linux-arm64 build/docker/api/linux-arm64/
docker build -t $REPO:$TAG-linux-x64 build/docker/api/linux-amd64/
docker build -t $REPO:$TAG-darwin-x64 build/docker/api/linux-amd64/
docker build -t $REPO:$TAG-windows-x64 build/docker/api/linux-amd64/
docker build -t $REPO:$TAG-linux-arm64 build/docker/api/linux-arm64/
docker push $REPO
echo "private unstable"
./packer build build/build_branch.json
fi
@@ -0,0 +1,58 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "sg-traefik"
},
"apps": [{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"styles.css"
],
"scripts": ["../node_modules/chart.js/dist/Chart.bundle.min.js"],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [{
"project": "src/tsconfig.app.json",
"exclude": "**/node_modules/**"
},
{
"project": "src/tsconfig.spec.json",
"exclude": "**/node_modules/**"
},
{
"project": "e2e/tsconfig.e2e.json",
"exclude": "**/node_modules/**"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "css",
"component": {}
}
}
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
max_line_length = off
trim_trailing_whitespace = false
Oops, something went wrong.

0 comments on commit 2c2b601

Please sign in to comment.