Skip to content

Commit

Permalink
add and group more deploy parameters
Browse files Browse the repository at this point in the history
adds lotus docker image options
allows changing helm repo url for lotus-bundle chart

update html and js
  • Loading branch information
ognots committed Jul 20, 2021
1 parent c81137f commit 759a2f8
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
4 changes: 4 additions & 0 deletions controller/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ function doCreateBot(e) {
"address": $("#newBotWalletAddress").val(),
"exported": $("#newBotWalletExported").val(),
},
"helmchartrepourl": $("#newBotHelmChartRepoUrl").val(),
"helmchartversion": $("#newBotHelmChartVersion").val(),
"lotusdockerrepo": $("#newBotLotusDockerRepo").val(),
"lotusdockertag": $("#newBotLotusDockerTag").val()
}
fetch(url, {method: "POST", headers: getHeaders(), body: JSON.stringify(data)}).then(() => {
$("#addBotDone").show()
Expand Down
12 changes: 12 additions & 0 deletions controller/daemons.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,18 @@ func (c *Controller) newDaemonHandler(w http.ResponseWriter, r *http.Request) {
daemon.Region = regionid
helmchartversion := mux.Vars(r)["helmchartversion"]
daemon.HelmChartVersion = helmchartversion
helmchartrepourl := mux.Vars(r)["helmchartrepourl"]
daemon.HelmChartRepoUrl = helmchartrepourl
lotusdockerrepo := mux.Vars(r)["lotusdockerrepo"]
daemon.LotusDockerRepo = "coryschwartz/lotus"
if lotusdockerrepo != "" {
daemon.LotusDockerRepo = lotusdockerrepo
}
lotusdockertag := mux.Vars(r)["lotusdockertag"]
daemon.LotusDockerTag = "sidecar"
if lotusdockertag != "" {
daemon.LotusDockerTag = lotusdockertag
}
// generate random values if they aren't already setup
daemonDefaults(daemon)
if err := c.spawner.Spawn(daemon); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion controller/spawn/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ wallets:
# api.chain.love is a lotus-gateway instance managed by Protocol Labs.
# It provides a limited set of lotus API endpoints.
lotus:
image: coryschwartz/lotus:sidecar
image: {{ .LotusDockerRepo }}:{{ .LotusDockerTag }}
lite:
enabled: false
backend: wss://api.chain.love
Expand Down
3 changes: 3 additions & 0 deletions controller/spawn/spawner.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ type Daemon struct {
DockerRepo string `json:"dockerrepo,omitempty"`
DockerTag string `json:"dockertag,omitempty"`
HelmChartVersion string `json:"helmchartversion,omitempty"`
HelmChartRepoUrl string `json:"helmchartrepourl,omitempty"`
LotusDockerRepo string `json:"lotusdockerrepo,omitempty"`
LotusDockerTag string `json:"lotusdockertag,omitempty"`
Wallet *Wallet `json:"wallet,omitempty"`
}

Expand Down
20 changes: 19 additions & 1 deletion controller/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,25 @@ <h2 class="accordion-header" id="headingBotCreate">
<label for="newBotWalletExported" class="form-label">Exported, i.e. `lotus wallet export`: (optional)</label>
<input class="form-control" type="text" id="newBotWalletExported" value="">
</div>

<div style="padding: 20px; background: #EEE; margin: 20px 0;">
<h4>Deployment Parameters</h3>
<div id="botHelmChartRepoUrl">
<label for="newBotHelmChartRepoUrl" class="form-label">Helm chart repo URL for lotus-bundle (optional)</label>
<input class="form-control" type="text" id="newBotHelmChartRepoUrl" value="">
</div>
<div id="botHelmChartVersion">
<label for="newBotHelmChartVersion" class="form-label">Helm chart version of lotus-bundle. Leave blank to use latest</label>
<input class="form-control" type="text" id="newBotHelmChartVersion" value="0.0.4">
</div>
<div id="botLotusDockerRepo">
<label for="newBotLotusDockerRepo" class="form-label">Lotus Docker Image (optional)</label>
<input class="form-control" type="text" id="newBotLotusDockerRepo" value="">
</div>
<div id="botLotusDockerTag">
<label for="newBotLotusDockerTag" class="form-label">Lotus Docker Image Tag</label>
<input class="form-control" type="text" id="newBotLotusDockerTag" value="v1.10.0">
</div>
</div>
<div id="addbot">
<button type="button" class="btn btn-primary">Add Bot</button>
<label for="addbot" id="addBotDone">
Expand Down

0 comments on commit 759a2f8

Please sign in to comment.