Skip to content

Commit e9353f0

Browse files
committed
frontend: add 'Install from source'
1 parent 84f02b7 commit e9353f0

File tree

5 files changed

+118
-19
lines changed

5 files changed

+118
-19
lines changed

frontend/app/doc/tip/common.component.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ footer {
5555
}
5656

5757
.footer-link {
58-
color: blue;
58+
color: dodgerblue;
5959
text-decoration: none !important;
6060
font-family: 'Inconsolata', sans-serif;
6161
font-size: 12px;
@@ -186,7 +186,7 @@ https://codepen.io/JohJakob/pen/YPxgwo
186186

187187
.osx-window .window {
188188
background: #fff;
189-
max-width: 50em;
189+
max-width: 52em;
190190
margin-top: 20px;
191191
margin-bottom: 20px;
192192
border: 1px solid #acacac;
@@ -376,7 +376,7 @@ section.features .feature-grid .feature p {
376376
max-width: 1170px;
377377
margin-left: auto;
378378
margin-right: auto;
379-
padding: 0 15px
379+
padding: 0 10px
380380
}
381381

382382
.inner::after {
@@ -387,7 +387,7 @@ section.features .feature-grid .feature p {
387387

388388
@media screen and (min-width: 768px) {
389389
.inner {
390-
padding: 0 30px
390+
padding: 0 20px
391391
}
392392
}
393393

frontend/app/doc/tip/common.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Component } from '@angular/core';
22

33
export class Version {
4+
goVersion: string;
45
etcdVersion: string;
56
etcdVersionURL: string;
67
etcdVersionLatestRelease: string;
@@ -9,6 +10,7 @@ export class Version {
910

1011
export class Versioner {
1112
version: Version = {
13+
goVersion: '1.7.1',
1214
etcdVersion: 'tip',
1315
etcdVersionURL: 'tip',
1416
etcdVersionLatestRelease: 'v3.1.0-alpha.1',
@@ -56,7 +58,7 @@ export class parentComponent {
5658
),
5759
new sidebarItem(
5860
'Kubernetes controller',
59-
'manage, automate etcd cluster operations using Kubernetes',
61+
'automate etcd cluster operations using Kubernetes',
6062
`/doc/${this.version.etcdVersionURL}/kubernetes-controller`,
6163
'no-text-decoration'
6264
),

frontend/app/doc/tip/install-deploy.component.html

Lines changed: 53 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ <h5 style="line-height: 0.07;">Why?</h5>
107107

108108
<br>
109109
<h5 style="line-height: 0.07;">Install cfssl</h5>
110-
<!--<pre class="code-dark">{{getCfsslCommandInitial()}}</pre>-->
111110
<div class="osx-window">
112111
<div class="window-narrow">
113112
<div class="titlebar">
@@ -145,6 +144,58 @@ <h5 style="line-height: 0.07;">Generate local-issued certificates with private k
145144
</template>
146145
</md-tab>
147146

147+
148+
<md-tab>
149+
<template md-tab-label>
150+
Build from source
151+
</template>
152+
<template md-tab-content>
153+
<br>
154+
<p>
155+
etcd is written in Go. To build from source, you need Go 1.7+. This assumes host OS is Linux.
156+
</p>
157+
<p>
158+
<md-input type="text" [(ngModel)]="inputGoVersion" placeholder="Go version"></md-input>
159+
</p>
160+
<div class="osx-window">
161+
<div class="window">
162+
<div class="titlebar">
163+
<div class="buttons">
164+
<div class="closebtn"><span><strong></strong></span></div>
165+
<div class="minimize"><span><strong></strong></span></div>
166+
<div class="zoom"><span><strong></strong></span></div>
167+
</div><span class="title-bar-text">terminal</span></div>
168+
<div class="content">
169+
<pre class="osx-terminal-contents">{{getGoCommand()}}</pre>
170+
</div>
171+
</div>
172+
</div>
173+
<br>
174+
<p>
175+
Now let's build etcd from source.
176+
</p>
177+
<p>
178+
<md-input type="text" [(ngModel)]="inputGitUser" placeholder="Git User"></md-input>
179+
<md-input type="text" [(ngModel)]="inputGitBranch" placeholder="Git Branch"></md-input>
180+
</p>
181+
<div class="osx-window">
182+
<div class="window">
183+
<div class="titlebar">
184+
<div class="buttons">
185+
<div class="closebtn"><span><strong></strong></span></div>
186+
<div class="minimize"><span><strong></strong></span></div>
187+
<div class="zoom"><span><strong></strong></span></div>
188+
</div><span class="title-bar-text">terminal</span></div>
189+
<div class="content">
190+
<pre class="osx-terminal-contents">{{getEtcdCommandBuildFromSource()}}</pre>
191+
</div>
192+
</div>
193+
</div>
194+
<br>
195+
</template>
196+
</md-tab>
197+
198+
148199
<md-tab>
149200
<template md-tab-label>
150201
Bare metal, VM
@@ -160,8 +211,7 @@ <h5 style="line-height: 0.07;">Why?</h5>
160211
</p>
161212

162213
<br>
163-
<h5 style="line-height: 0.07;">Initial Settings</h5>
164-
<!--<pre class="code-dark">{{getEtcdCommandInitial()}}</pre>-->
214+
<h5 style="line-height: 0.07;">Install releases</h5>
165215
<div class="osx-window">
166216
<div class="window-narrow">
167217
<div class="titlebar">

frontend/app/doc/tip/install-deploy.component.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ export class install_deploy_tip_Component extends parentComponent {
8484
inputCommonName: string;
8585
////////////////////////////////////
8686

87+
inputGoVersion: string;
88+
inputGitUser: string;
89+
inputGitBranch: string;
90+
8791
////////////////////////////////////
8892
// etcd setting properties
8993
inputSecure: boolean;
@@ -122,6 +126,10 @@ export class install_deploy_tip_Component extends parentComponent {
122126
this.inputEnableProfile = false;
123127
this.inputDebug = false;
124128

129+
this.inputGoVersion = super.getVersion().goVersion;
130+
this.inputGitUser = 'coreos';
131+
this.inputGitBranch = 'master';
132+
125133
this.etcdVersionLatestRelease = super.getVersion().etcdVersionLatestRelease;
126134
this.inputEtcdVersion = this.etcdVersionLatestRelease;
127135

@@ -286,6 +294,45 @@ cfssl gencert` + ' \\' + `
286294
` + `/tmp/certs/request-ca-csr-${flag.name}.json | cfssljson --bare /tmp/certs/${flag.name}`;
287295
}
288296

297+
getGoCommand() {
298+
return `GO_VERSION=${this.inputGoVersion}
299+
300+
sudo rm -f /usr/local/go/bin/go && sudo rm -rf /usr/local/go
301+
302+
GOOGLE_URL=https://storage.googleapis.com/golang
303+
` + 'DOWNLOAD_URL=${GOOGLE_URL}' + `
304+
305+
` + 'sudo curl -s ${DOWNLOAD_URL}/go$GO_VERSION.linux-amd64.tar.gz | sudo tar -v -C /usr/local/ -xz' + `
306+
307+
` + 'if grep -q GOPATH "$(echo $HOME)/.bashrc"; then ' + `
308+
echo "bashrc already has GOPATH";
309+
else
310+
echo "adding GOPATH to bashrc";` + `
311+
` + 'echo "export GOPATH=$(echo $HOME)/go" >> $HOME/.bashrc;' + `
312+
` + 'PATH_VAR=$PATH":/usr/local/go/bin:$(echo $HOME)/go/bin";' + `
313+
` + 'echo "export PATH=$(echo $PATH_VAR)" >> $HOME/.bashrc;' + `
314+
` + 'source $HOME/.bashrc;' + `
315+
fi
316+
317+
mkdir -p $GOPATH/bin/
318+
go version
319+
`;
320+
}
321+
322+
getEtcdCommandBuildFromSource() {
323+
return `GIT_PATH=github.com/coreos/etcd
324+
325+
USER_NAME=${this.inputGitUser}
326+
BRANCH_NAME=${this.inputGitBranch}
327+
328+
` + 'rm -rf $HOME/go/src/${GIT_PATH}' + `
329+
` + 'git clone https://github.com/${USER_NAME}/etcd --branch ${BRANCH_NAME} $HOME/go/src/${GIT_PATH}' + `
330+
331+
` + 'cd $HOME/go/src/${GIT_PATH} && ./build' + `
332+
333+
` + '$HOME/go/src/${GIT_PATH}/bin/etcd -version';
334+
}
335+
289336
getEtcdCommandInitial() {
290337
return `ETCD_VER=${this.inputEtcdVersion}
291338

frontend/app/doc/tip/why.component.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,18 @@ <h2><a href="/doc/{{version.etcdVersionURL}}/why#when-not-to-use">When Not to Us
8383
class="code-link">maxRequestBytes</a>). And default storage size limit is 2GB (see <a href="https://github.com/coreos/etcd/blob/master/mvcc/backend/backend.go#L46-L53" target="_blank" class="code-link">DefaultQuotaBytes</a>). These
8484
are the tradeoffs required for strong consistency. So if you need higher availability or bigger storage size, etcd might not be the option.
8585
</p>
86+
87+
<br><br>
88+
<hr align="left" class="footer-top-line">
89+
<footer>
90+
[1] Diego Ongaro and John K Ousterhout: "<a href="https://raft.github.io/raft.pdf" target="_blank" class="footer-link">In Search of an Understandable Consensus Algorithm (Extended Version)</a>," at USENIX Annual Technical Conference
91+
(ATC), June 2014.
92+
<br> [2] Maurice P Herlihy and Jeannette M Wing: "<a href="http://www.cs.cornell.edu/andru/cs711/2002fa/reading/linearizability.pdf" target="_blank" class="footer-link">Linearizability: A Correctness Condition for Concurrent Objects</a>,"
93+
ACM Transactions on Programming Languages and Systems (TOPLAS), volume 12, number 3, pages 463–492, July 1990.
94+
<br> [3] David K Gifford: "<a href="http://dl.acm.org/citation.cfm?id=910052" target="_blank" class="footer-link">Information Storage in a Decentralized Computer System</a>," Xerox Palo Alto Research Centers, CSL-81-8, June 1981.
95+
<br> [4] Peter Bailis and Kyle Kingsbury: "<a href="http://queue.acm.org/detail.cfm?id=2655736" target="_blank" class="footer-link">The Network is Reliable</a>," ACM Queue, volume 12, number 7, July 2014.
96+
</footer>
8697
</div>
8798
</section>
88-
89-
<br><br>
90-
<hr align="left" class="footer-top-line">
91-
<footer>
92-
[1] Diego Ongaro and John K Ousterhout: "<a href="https://raft.github.io/raft.pdf" target="_blank" class="footer-link">In Search of an Understandable Consensus Algorithm (Extended Version)</a>," at USENIX Annual Technical Conference (ATC),
93-
June 2014.
94-
<br> [2] Maurice P Herlihy and Jeannette M Wing: "<a href="http://www.cs.cornell.edu/andru/cs711/2002fa/reading/linearizability.pdf" target="_blank" class="footer-link">Linearizability: A Correctness Condition for Concurrent Objects</a>,"
95-
ACM Transactions on Programming Languages and Systems (TOPLAS), volume 12, number 3, pages 463–492, July 1990.
96-
<br> [3] David K Gifford: "<a href="http://dl.acm.org/citation.cfm?id=910052" target="_blank" class="footer-link">Information Storage in a Decentralized Computer System</a>," Xerox Palo Alto Research Centers, CSL-81-8, June 1981.
97-
<br> [4] Peter Bailis and Kyle Kingsbury: "<a href="http://queue.acm.org/detail.cfm?id=2655736" target="_blank" class="footer-link">The Network is Reliable</a>," ACM Queue, volume 12, number 7, July 2014.
98-
</footer>
9999
</div>
100100
</md-sidenav-layout>

0 commit comments

Comments
 (0)