Skip to content

Commit 77fce96

Browse files
Sync up files with master
1 parent f726af9 commit 77fce96

File tree

7 files changed

+341
-3
lines changed

7 files changed

+341
-3
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
**Rancher versions:**
2+
rancher/server:
3+
rancher/agent:
4+
5+
**Infrastructure Stack versions:**
6+
healthcheck:
7+
ipsec:
8+
network-services:
9+
scheduler:
10+
kubernetes (if applicable):
11+
12+
**Docker version: (`docker version`,`docker info` preferred)**
13+
14+
**Operating system and kernel: (`cat /etc/os-release`, `uname -r` preferred)**
15+
16+
**Type/provider of hosts: (VirtualBox/Bare-metal/AWS/GCE/DO)**
17+
18+
**Setup details: (single node rancher vs. HA rancher, internal DB vs. external DB)**
19+
20+
**Environment Template: (Cattle/Kubernetes/Swarm/Mesos)**
21+
22+
**Steps to Reproduce:**
23+
24+
**Results:**

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,3 +175,4 @@
175175
of your accepting any such warranty or additional liability.
176176

177177
END OF TERMS AND CONDITIONS
178+

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Rancher is an open source project that provides a complete platform for operatin
44

55
## Latest Release
66

7-
* Beta - v1.6.12 - `rancher/server:latest` - Read the full release [notes](https://github.com/rancher/rancher/releases/tag/v1.6.12).
7+
* Beta - v1.6.14 - `rancher/server:latest` - Read the full release [notes](https://github.com/rancher/rancher/releases/tag/v1.6.14).
88

9-
* Stable - v1.6.12 - `rancher/server:stable` - Read the full release [notes](https://github.com/rancher/rancher/releases/tag/v1.6.12).
9+
* Stable - v1.6.14 - `rancher/server:stable` - Read the full release [notes](https://github.com/rancher/rancher/releases/tag/v1.6.14).
1010

1111
To get automated notifications of our latest release, you can watch the announcements category in our [forums](http://forums.rancher.com/c/announcements), or subscribe to the RSS feed `https://forums.rancher.com/c/announcements.rss`.
1212

@@ -43,7 +43,7 @@ This repo is a meta-repo used for packaging. The source code for Rancher is in
4343
## Support, Discussion, and Community
4444
If you need any help with Rancher or RancherOS, please join us at either our [Rancher forums](http://forums.rancher.com/), [#rancher IRC channel](http://webchat.freenode.net/?channels=rancher) or [Slack](https://slack.rancher.io/) where most of our team hangs out at.
4545

46-
Please submit any **Rancher** bugs, issues, and feature requests to [rancher/rancher](//github.com/rancher/rancher/issues).
46+
Please submit any **Rancher** bugs, issues, and feature requests to [rancher/rancher](//github.com/rancher/rancher/issues).
4747

4848
Please submit any **RancherOS** bugs, issues, and feature requests to [rancher/os](//github.com/rancher/os/issues).
4949

keybase.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
### Keybase proof
2+
3+
I hereby claim:
4+
5+
* I am rancher on github.
6+
* I am rancher (https://keybase.io/rancher) on keybase.
7+
* I have a public key whose fingerprint is 6ECB 4922 01B6 267E 769E 00B3 1375 50C2 2320 5F53
8+
9+
To claim this, I am signing this object:
10+
11+
```json
12+
{
13+
"body": {
14+
"key": {
15+
"eldest_kid": "01207d08625ab62748f2699d506da5e32ff4e2147334ff3eaed647c80f4b2840277e0a",
16+
"fingerprint": "6ecb492201b6267e769e00b3137550c223205f53",
17+
"host": "keybase.io",
18+
"key_id": "137550c223205f53",
19+
"kid": "0101780bb862682086970b5944deee85c9a44da737120979bfdf8e4f62352c9baa550a",
20+
"uid": "01b937b34ac988003e7eccf9d986f719",
21+
"username": "rancher"
22+
},
23+
"service": {
24+
"name": "github",
25+
"username": "rancher"
26+
},
27+
"type": "web_service_binding",
28+
"version": 1
29+
},
30+
"ctime": 1483751337,
31+
"expire_in": 157680000,
32+
"prev": "49a429873da4ae85d3a5ed8da2bc1b877ec660cb23fe07c80f77a5187bfa7672",
33+
"seqno": 8,
34+
"tag": "signature"
35+
}
36+
```
37+
38+
with the key [6ECB 4922 01B6 267E 769E 00B3 1375 50C2 2320 5F53](https://keybase.io/rancher), yielding the signature:
39+
40+
```
41+
-----BEGIN PGP MESSAGE-----
42+
Version: Keybase OpenPGP v2.0.61
43+
Comment: https://keybase.io/crypto
44+
45+
yMNaAnicdVJrTBRXGN1FJBFEsFhSCxEYiwWyhTt3ZufObAQsaGyM6YtSISCbedxZ
46+
xsey7ovySolb0hpLGzUUsQKlKo9aSzGxEaoGF2wp2oBKsWKlkIIEY2khFa0V7F2C
47+
/9pf997vnnNyvvN93cFLdIH6MNfr3rXR5gz95YuVLl2WLbWlhJIKlCLKVELtxAsH
48+
3qVgh9O8U1MoEwVoCJACeA4aRYmDiOVVyAmCYgScIhoxA1WVxZBmEcOwqspgESsc
49+
i2QeqKwEeRZAhDAQKQOlalYLttvsmtVJZDksS6wAIaCJKIcw4gQMgMTQDDIagQwh
50+
A4FRNTKEmF/g8DGIOUl04EStgNTIw7xg7z/wT30DGvFAkohzjoekAQEBySiwrIIx
51+
5o2yIJKriBhEGhSQIKmKymNW5SBjhLIgiSLR9fl2LcpJAoMkhhVlgecBYDDCsqwK
52+
isBzKqIFH9CB7VZxNyZou2iV87GdKjNQpOjWZOzLdfHTojnzXdL/EpxFNl+lEEvm
53+
Ra5Z0qwKSY9Q3Nju0AqslIkmSNmp+cg0y5MQaIZBBgq/Y9Ps2Kz5EEbEEaMAGCib
54+
HbuJJEtahgKPGEVkRRKBwpABKrwiQkmmJZ4MSuY4IEuQUTFYGCFCopHmkaSKiEOQ
55+
8nWzx1pAmXhiU7QQSYdmsYpOlx1TZd6Luf46faAuYKmfb6t0gctCn+5aU0rIkx3p
56+
R0Y4B2j5LfLLP7mZ02nDzYnT+9tqI+8tz5mOL1/92eVXY9NPODPD/r7Ftq4Dqkcz
57+
vBfX1h/djlvKJs4E5Az2pta4D5VN3L/6Q3135cj556l9hS9MVkHqsPvkm5ei9nqH
58+
ese3J9tXjVbDH4sHj64S9e6Nod5N86lJVzO8ead/qtgWkRak/3owstVuNZhkXWSm
59+
rHi8f9wIr0jY6jezNjQ635A75Nd3fTwhrXlDF39wS8LPjSfOhwTt0r+ycjLq4MN1
60+
fRK9sZqbrova5Drbda5/6Gj5o2ZP7kC7u3TrL+eYzk8+rxnLrX9upqe1NsvQHN6V
61+
99X68ozqpTXZjzbvvpLR8ddx50f9sUUnzW0RZy5lZL+YuKPn8HDiqb0Nadxx8cAc
62+
TM/xuNXMZ0OarNeyJ19unXpbTWkxxI97UwYC6q2RcWdPrbgVsfnAWGdhTFXr8rE3
63+
Sotjvx+ttW1pnN3un2YenZr9tevbBhDYVhpc0rlmX+zN8Du4Uj706fqKJyOWZab3
64+
Pab6kttXei5s6Pjnw9+/OxLnf6fJFJO3P1ELmrow3NLU1OexpK2su5n0RbfgyRq4
65+
4Xmp/GFUev/Hj6+7UuazGlZ0zi2Br/Vue8Yw5IB344fW3P4m5t09j8Ma85hrD3BH
66+
MOj9oMrjx8y9VRd9N/nebP18cXuUIey+3+oHxxIGkmcq+yZ6e44l/QtAs7lS
67+
=rBA0
68+
-----END PGP MESSAGE-----
69+
70+
```
71+
72+
And finally, I am proving ownership of the github account by posting this as a gist.
73+
74+
### My publicly-auditable identity:
75+
76+
https://keybase.io/rancher
77+
78+
### From the command line:
79+
80+
Consider the [keybase command line program](https://keybase.io/download).
81+
82+
```bash
83+
# look me up
84+
keybase id rancher
85+
```
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
#!/usr/bin/env python2.7
2+
3+
# Requires git, python 2.7 and python modules 'PyYAML' and 'semver'
4+
#
5+
# apt-get install git python-pip
6+
# pip install -r requirements.txt
7+
8+
import argparse
9+
import os
10+
import re
11+
import semver
12+
import sets
13+
import subprocess
14+
import sys
15+
import uuid
16+
import yaml
17+
18+
description = """Computes Docker images required to run each infrastructure service for a
19+
specific Rancher version. This is valuable when preparing an air-gapped Rancher
20+
installation for the latest infrastructure services without legacy image bloat.
21+
"""
22+
23+
parser = argparse.ArgumentParser(description=description)
24+
25+
parser.add_argument('-u', '--url',
26+
default='https://git.rancher.io/rancher-catalog',
27+
help='Rancher catalog URL accessible in airgap environment')
28+
parser.add_argument('-b', '--branch',
29+
help='Rancher catalog branch accessible in airgap environment')
30+
parser.add_argument('-v', '--version',
31+
required=True,
32+
help='Rancher Server version')
33+
args = parser.parse_args()
34+
35+
36+
def get_catalog_branch(version):
37+
if semver.match(version, "<=1.6.0"):
38+
return "master"
39+
elif semver.match(version, ">1.6.0") and semver.match(version, "<2.0.0"):
40+
return "v1.6-release"
41+
elif semver.match(version, ">=2.0.0"):
42+
return "v2.0-release"
43+
else:
44+
print "Unknown version"
45+
sys.exit(1)
46+
47+
48+
def print_keys(header, iter):
49+
temp = header
50+
for key in iter.iterkeys():
51+
temp += " " + key
52+
print temp
53+
54+
55+
def optimal_version_dir(rancher_version, service_dir):
56+
# Parse each version dir's rancher-compose.yml
57+
version_dirs = {}
58+
for service_version_dir in os.listdir(service_dir):
59+
version_dir = service_dir + "/" + service_version_dir
60+
if os.path.isdir(version_dir):
61+
rancher_compose_filepath = version_dir + "/rancher-compose.yml"
62+
if os.path.isfile(rancher_compose_filepath):
63+
try:
64+
with file(rancher_compose_filepath, 'r') as f:
65+
rancher_compose = yaml.load(f)
66+
version_dirs[service_version_dir] = rancher_compose
67+
except yaml.YAMLError, exc:
68+
print "Error in rancher-compose.yml file: ", exc
69+
else:
70+
print version_dir + ": missing rancher-compose.yml"
71+
# print_keys("Unfiltered:", version_dirs)
72+
73+
# Filter version dirs by min/max rancher version
74+
filtered = {}
75+
for key, value in version_dirs.iteritems():
76+
if '.catalog' in value:
77+
catalog = value['.catalog']
78+
if 'minimum_rancher_version' in catalog:
79+
min_version = catalog['minimum_rancher_version'].lstrip('v')
80+
if semver.compare(rancher_version, min_version) < 0:
81+
continue
82+
if 'maximum_rancher_version' in catalog:
83+
max_version = catalog['maximum_rancher_version'].lstrip('v')
84+
if semver.compare(rancher_version, max_version) > 0:
85+
continue
86+
filtered[key] = value
87+
# print_keys("Server Version:", filtered)
88+
89+
# Bail out if only one remains
90+
if len(filtered) == 1:
91+
for key, value in filtered.iteritems():
92+
return key, value['.catalog']['version']
93+
return list(filtered)[0]
94+
95+
# Try to return the template version in config.yml
96+
try:
97+
template_config = yaml.load(file(service_dir + "/config.yml", 'r'))
98+
if 'version' in template_config:
99+
version = template_config['version']
100+
for key, value in filtered.iteritems():
101+
if '.catalog' in value:
102+
catalog = value['.catalog']
103+
if 'version' in catalog and catalog['version'] == version:
104+
return key, value['.catalog']['version']
105+
except yaml.YAMLError, exc:
106+
print "Error in config.yml file: ", exc
107+
108+
# Choose the highest ordinal value
109+
maxkey = -1
110+
for key in filtered.iterkeys():
111+
try:
112+
keyint = int(key)
113+
if keyint > maxkey:
114+
maxkey = keyint
115+
except:
116+
pass
117+
if maxkey > -1:
118+
return str(maxkey), filtered[str(maxkey)]['.catalog']['version']
119+
else:
120+
return "", ""
121+
122+
123+
def version_images(service_version_dir):
124+
images = sets.Set()
125+
compose_filepath = service_version_dir + "/docker-compose.yml"
126+
compose_tpl_filepath = service_version_dir + "/docker-compose.yml.tpl"
127+
128+
filedata = ''
129+
if os.path.isfile(compose_tpl_filepath):
130+
with open(compose_tpl_filepath, 'r') as f:
131+
filedata = f.read()
132+
filedata, subs = re.subn('{{[^}]*}}', '', filedata)
133+
elif os.path.isfile(compose_filepath):
134+
with open(compose_filepath, 'r') as f:
135+
filedata = f.read()
136+
else:
137+
print "missing docker-compose.yml[.tpl]"
138+
return images
139+
140+
try:
141+
docker_compose = yaml.load(filedata)
142+
# handle v1/v2 docker-compose
143+
services = docker_compose
144+
if 'services' in services:
145+
services = docker_compose['services']
146+
147+
for serviceName in services:
148+
service = services[serviceName]
149+
if 'image' in service:
150+
images.add(service['image'])
151+
152+
except yaml.YAMLError, exc:
153+
print "Error in docker-compose.yml file: ", exc
154+
155+
return images
156+
157+
158+
version = args.version.lstrip('v')
159+
if args.branch is None:
160+
args.branch = get_catalog_branch(version)
161+
162+
print 'Rancher Version: ' + version
163+
print 'Catalog URL: ' + args.url
164+
print 'Catalog Branch: ' + args.branch
165+
print
166+
167+
catalog_dir = str(uuid.uuid4())
168+
try:
169+
subprocess.check_call(["git", "clone", args.url,
170+
"--quiet", "--single-branch", "--branch", args.branch,
171+
catalog_dir])
172+
except subprocess.CalledProcessError:
173+
sys.exit(1)
174+
175+
176+
infra_dir = catalog_dir + "/infra-templates"
177+
for infra_service in os.listdir(infra_dir):
178+
service_dir = infra_dir + "/" + infra_service
179+
if os.path.isdir(service_dir):
180+
version_dir, template_ver = optimal_version_dir(version, service_dir)
181+
if version_dir != "":
182+
print infra_service + ": " + template_ver
183+
for image in version_images(service_dir + "/" + version_dir):
184+
print " - " + image
185+
186+
subprocess.call(["rm", "-rf", catalog_dir])
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
PyYAML==3.11
2+
semver==2.7.7
3+
flake8

scripts/print-tags.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
3+
if [ -z "$1" ]; then
4+
master="(Rancher tag not specified)"
5+
tag='master'
6+
else
7+
tag=$1
8+
fi
9+
10+
CATTLE_VER=$(curl https://raw.githubusercontent.com/rancher/rancher/$tag/server/Dockerfile 2>/dev/null | grep 'ENV CATTLE_CATTLE_VERSION' | awk '{print $3}')
11+
12+
echo -e "\nPrinting project/service tag information for Rancher tag $tag. $master"
13+
14+
echo -e "\nCattle Tag: $CATTLE_VER\n"
15+
16+
echo "Other project tags:"
17+
while read -r l; do
18+
PROP=$(echo "$l" | awk -F= '{print $1}')
19+
URL=$(echo "$l" | awk -F= '{print $2}')
20+
IFS=', ' read -r -a array <<< "$(echo $l | awk -F= '{print $2}')"
21+
for element in "${array[@]}"
22+
do
23+
if [[ $element == http* ]]; then
24+
URL=$element
25+
fi
26+
done
27+
28+
VER_AND_FILE=$(echo "$l" | grep "releases/download" | sed "s/^.*download\///g")
29+
#echo $VER_AND_FILE
30+
VER=$(echo "$VER_AND_FILE" | awk -F/ '{print $1}')
31+
FILE=$(echo "$VER_AND_FILE" | awk -F/ '{print $2}')
32+
if [[ -n "$VER" ]]; then
33+
printf "%40s %15s %s\n" "$PROP" "$VER" "$URL"
34+
fi
35+
36+
done < <(curl -s https://raw.githubusercontent.com/rancher/cattle/$CATTLE_VER/resources/content/cattle-global.properties)
37+
38+
echo -e "\n\nCatalog item versions: (Pulling image may take several minutes)"
39+
docker run --rm -it rancher/server:$tag bash -c 'for i in /var/lib/cattle/cache/global/*; do git -C $i remote -vv; git -C $i rev-parse HEAD; for j in $i/infra-templates/*; do A=$(grep version $j/config.yml 2>/dev/null | cut -d" " -f2); echo $(basename $j): $A; for x in $(grep -Irl --exclude=config.yml $A $j 2>/dev/null); do grep -rh --include="docker-compose.*" -e "^[ \t]*image: " $(dirname $x) 2>/dev/null; done; done; echo -e "\n"; done' 2>/dev/null

0 commit comments

Comments
 (0)