Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitedfe757

Browse files
committed
Added goreleaser config file. Added dockerfile for docker build. Did some small fine tuning
1 parent8574ec7 commitedfe757

File tree

9 files changed

+85
-15
lines changed

9 files changed

+85
-15
lines changed

‎.goreleaser.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
before:
2+
hooks:
3+
-make compile_frontend static_assets
4+
builds:
5+
-main:./cmd/gaia/main.go
6+
binary:gaia-linux-amd64
7+
goos:
8+
-linux
9+
goarch:
10+
-amd64
11+
checksum:
12+
name_template:'checksums.txt'
13+
release:
14+
prerelease:true
15+
changelog:
16+
sort:asc
17+
filters:
18+
exclude:
19+
-'^docs:'
20+
-'^test:'
21+
dockers:
22+
-image:gaia-pipeline/gaia
23+
skip_push:true
24+
dockerfile:docker/Dockerfile
25+
extra_files:
26+
-docker/docker-entrypoint.sh
27+
tag_templates:
28+
-"{{ .Tag }}-go"
29+
-latest

‎Makefile‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ static_assets:
1616
rm -f rice-box.go&&\
1717
rice embed-go
1818

19-
release: compile_frontend static_assets
19+
compile_backend:
2020
env GOOS=linux GOARCH=amd64 go build -o gaia-linux-amd64 ./cmd/gaia/main.go
2121

22-
compile_backend:
23-
env GOOS=linux GOARCH=amd64 go build -o gaia-linux-amd64 ./cmd/gaia/main.go
22+
release: compile_frontend static_assets compile_backend

‎cmd/gaia/main.go‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func init() {
3434
// command line arguments
3535
flag.StringVar(&gaia.Cfg.ListenPort,"port","8080","Listen port for gaia")
3636
flag.StringVar(&gaia.Cfg.HomePath,"homepath","","Path to the gaia home folder")
37-
flag.IntVar(&gaia.Cfg.Workers,"workers",2,"Number ofworkers gaia will use to execute pipelines in parallel")
37+
flag.StringVar(&gaia.Cfg.Worker,"worker","2","Number ofworker gaia will use to execute pipelines in parallel")
3838
flag.BoolVar(&gaia.Cfg.DevMode,"dev",false,"If true, gaia will be started in development mode. Don't use this in production!")
3939
flag.BoolVar(&gaia.Cfg.VersionSwitch,"version",false,"If true, will print the version and immediately exit")
4040

@@ -105,7 +105,11 @@ func main() {
105105

106106
// Initialize scheduler
107107
scheduler:=scheduler.NewScheduler(store)
108-
scheduler.Init()
108+
err=scheduler.Init()
109+
iferr!=nil {
110+
gaia.Cfg.Logger.Error("cannot initialize scheduler:","error",err.Error())
111+
os.Exit(1)
112+
}
109113

110114
// Initialize handlers
111115
err=handlers.InitHandlers(echoInstance,store,scheduler)

‎docker/Dockerfile‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM golang:1.10.3-alpine
2+
3+
# Version and other variables which can be changed.
4+
ENV GAIA_PORT=8080 \
5+
GAIA_WORKER=2 \
6+
GAIA_HOMEPATH=/data
7+
8+
# Directory for the binary
9+
WORKDIR /app
10+
11+
# Copy gaia binary into docker image
12+
COPY gaia-linux-amd64 /app
13+
14+
# Fix permissions and install git
15+
RUN chmod +x ./gaia-linux-amd64 && \
16+
apk add --no-cache --virtual git
17+
18+
# Set homepath as volume
19+
VOLUME ["${GAIA_HOMEPATH}" ]
20+
21+
# Expose port
22+
EXPOSE ${GAIA_PORT}
23+
24+
# Copy entry point script
25+
COPY docker-entrypoint.sh /usr/local/bin/
26+
27+
# Start gaia
28+
ENTRYPOINT ["docker-entrypoint.sh" ]

‎docker/docker-entrypoint.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
3+
# Start gaia
4+
exec /app/gaia-linux-amd64 --port=${GAIA_PORT} --homepath=${GAIA_HOMEPATH} --worker=${GAIA_WORKER}

‎frontend/client/views/pipeline/create.vue‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
</a>
3535
</p>
3636
<hrclass="dotted-line">
37-
<labelclass="label">Type the name of your pipeline. You can put your pipelines into folders by defining a path. For example
38-
<strong>MyFolder/MyAwesomePipeline</strong>.</label>
37+
<labelclass="label">Type the name of your pipeline here.</label>
3938
<pclass="control has-icons-left"v-bind:class="{ 'has-icons-right': pipelineNameSuccess }">
4039
<inputclass="input is-medium input-bar"v-model="pipelinename"v-on:input="checkPipelineNameAvailableDebounce"type="text"placeholder="Pipeline name ...">
4140
<spanclass="icon is-small is-left">
@@ -105,8 +104,8 @@
105104
</td>
106105
<td>{{ props.row.pipeline.type }}</td>
107106
<td:title="props.row.created"v-tippy="{ arrow : true, animation : 'shift-away'}">{{ convertTime(props.row.created) }}</td>
108-
<td>
109-
<span:title="props.row.errmsg"v-tippy="{ arrow : true, animation : 'shift-away'}"class="is-blue">Output</span>
107+
<td:title="props.row.errmsg"v-tippy="{ arrow : true, animation : 'shift-away'}">
108+
<spanclass="is-blue">Output</span>
110109
</td>
111110
</template>
112111
<divslot="emptystate"class="empty-table-text">

‎gaia.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ type Config struct {
152152
DataPathstring
153153
PipelinePathstring
154154
WorkspacePathstring
155-
Workersint
155+
Workerstring
156156
Logger hclog.Logger
157157

158158
Boltstruct {

‎pipeline/create_pipeline.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ func CreatePipeline(p *gaia.CreatePipeline) {
6464
err=bP.ExecuteBuild(p)
6565
iferr!=nil {
6666
p.StatusType=gaia.CreatePipelineFailed
67-
p.Output=fmt.Sprintf("cannot compile pipeline: %s",err.Error())
6867
storeService.CreatePipelinePut(p)
6968
return
7069
}

‎scheduler/scheduler.go‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,15 @@ func NewScheduler(store *store.Store) *Scheduler {
5252
}
5353

5454
// Init initializes the scheduler.
55-
func (s*Scheduler)Init() {
56-
// Setup workers
57-
fori:=0;i<gaia.Cfg.Workers;i++ {
55+
func (s*Scheduler)Init()error {
56+
// Get number of worker
57+
w,err:=strconv.Atoi(gaia.Cfg.Worker)
58+
iferr!=nil {
59+
returnerr
60+
}
61+
62+
// Setup worker
63+
fori:=0;i<w;i++ {
5864
gos.work()
5965
}
6066

@@ -69,6 +75,8 @@ func (s *Scheduler) Init() {
6975
}
7076
}
7177
}()
78+
79+
returnnil
7280
}
7381

7482
// work takes work from the scheduled run buffer channel
@@ -319,7 +327,7 @@ func (s *Scheduler) scheduleJobsByPriority(r *gaia.PipelineRun, p *gaia.Pipeline
319327

320328
// getJobResultsAndStore
321329
func (s*Scheduler)getJobResultsAndStore(triggerSavechanbool,r*gaia.PipelineRun) {
322-
for_=rangetriggerSave {
330+
forrangetriggerSave {
323331
// Store update
324332
s.storeService.PipelinePutRun(r)
325333
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp