Skip to content

Commit e4091cb

Browse files
authored
Merge pull request #3 from st-tech/merge-digdag-master
Merge digdag master
2 parents 08946b2 + f30dec4 commit e4091cb

File tree

235 files changed

+13203
-5939
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

235 files changed

+13203
-5939
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ version: 2.0
22

33
jobs:
44
test:
5-
parallelism: 4
5+
parallelism: 8
66

77
# executor type https://circleci.com/docs/2.0/executor-types/
88
docker:
9-
- image: digdag/digdag-build:20180921T102000-413301ee05f9660e41af70cdcddf0c6e747f0cc1
9+
- image: digdag/digdag-build:20191203T225216-c5b7206657c98c728b183634079f0a919ee98f8c
1010
# environment Variables in a Job https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-job
1111
environment:
1212
TERM: dumb
@@ -54,7 +54,7 @@ jobs:
5454
docs_deployment:
5555
# executor type https://circleci.com/docs/2.0/executor-types/
5656
docker:
57-
- image: digdag/digdag-build:20180921T191208-befdec51e47abfa34143ee63a8c8929cbfc7c759
57+
- image: digdag/digdag-build:20191203T225216-c5b7206657c98c728b183634079f0a919ee98f8c
5858
# environment Variables in a Job https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-job
5959
environment:
6060
TERM: dumb

.gitignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@
66
*/build/
77
*/out/
88
*.pyc
9+
venv*
10+
.venv*
911
/dist/*.tar.gz
1012
/config/test_postgresql.properties
13+
/config/dummy.properties
1114
MANIFEST
1215
pom.xml
1316
.digdag
17+
docker/bootstrap/constraints.txt
18+
docker/bootstrap/requirements.txt
1419

1520
# intellij idea
1621
*.iml
@@ -20,4 +25,4 @@ pom.xml
2025

2126
# generated self-signed cert
2227
littleproxy_cert
23-
littleproxy_keystore.jks
28+
littleproxy_keystore.jks

.travis.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ sudo: required
22

33
language: java
44

5+
dist: trusty
6+
57
jdk:
68
- oraclejdk8
79

@@ -16,8 +18,8 @@ cache:
1618
env:
1719
global:
1820
- TERM=dumb
19-
- CI_NODE_TOTAL=8
20-
- BUILD_IMAGE=digdag/digdag-build:20180921T191208-befdec51e47abfa34143ee63a8c8929cbfc7c759
21+
- CI_NODE_TOTAL=12
22+
- BUILD_IMAGE=digdag/digdag-build:20191203T225216-c5b7206657c98c728b183634079f0a919ee98f8c
2123
matrix:
2224
- CI_NODE_INDEX=0
2325
- CI_NODE_INDEX=1
@@ -27,6 +29,10 @@ env:
2729
- CI_NODE_INDEX=5
2830
- CI_NODE_INDEX=6
2931
- CI_NODE_INDEX=7
32+
- CI_NODE_INDEX=8
33+
- CI_NODE_INDEX=9
34+
- CI_NODE_INDEX=10
35+
- CI_NODE_INDEX=11
3036

3137
before_install:
3238
- sudo service --status-all

README.md

+58-25
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,23 @@
88

99
Please check [digdag.io](https://digdag.io) and [docs.digdag.io](https://docs.digdag.io) for installation & user manual.
1010

11+
REST API document is available at [docs.digdag.io/api](http://docs.digdag.io/api/).
12+
1113
## Development
1214

1315
### Prerequirements
1416

1517
* JDK 8
16-
* Node.js 8.x
18+
* Node.js 12.x
1719

1820
Installing Node.js using nodebrew:
1921

2022
```
2123
$ curl -L git.io/nodebrew | perl - setup
2224
$ echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bashrc
2325
$ source ~/.bashrc
24-
$ nodebrew install-binary v8.x
25-
$ nodebrew use v8.x
26+
$ nodebrew install-binary v12.x
27+
$ nodebrew use v12.x
2628
```
2729

2830
Installing Node.js using Homebrew on Mac OS X:
@@ -36,18 +38,6 @@ $ brew install node
3638
* sphinx_rtd_theme
3739
* recommonmark
3840

39-
### Check Digdag REST API
40-
41-
Use `--enable-swagger` option to check the current Digdag REST API.
42-
43-
```
44-
$ ./gradlew cli
45-
$ ./pkg/digdag-<current version>.jar server --memory --enable-swagger # Run server with --enable-swagger option
46-
47-
$ docker run -dp 8080:8080 swaggerapi/swagger-ui # Run Swagger-UI on different console
48-
$ open http://localhost:8080/?url=http://localhost:65432/api/swagger.json # Open api/swagger.json on Swagger-UI
49-
```
50-
5141
### Running tests
5242

5343
```
@@ -86,23 +76,39 @@ It makes an executable in `pkg/`, e.g. `pkg/digdag-$VERSION.jar`.
8676
### Releasing a new version
8777

8878
You need to set Bintray user name and API key in `BINTRAY_USER` and `BINTRAY_KEY` environment variables.
89-
90-
1. run `git pull origin --tags`.
91-
2. run `./gradlew setVersion -Pto=<version>` command.
92-
3. write release notes to `releases/release-<version>.rst` file. It must include at least version (the first line) and release date (the last line).
93-
4. run `./gradlew clean cli site check releaseCheck`.
94-
5. if it succeeded, run `./gradlew release`.
79+
In the following instructions, assumed that `upstream` is set to `treasure-data/digdag` and `origin` is set to your private repository.
80+
81+
1. run `git pull upstream master --tags`.
82+
1. run `./gradlew setVersion -Pto=<version>` command.
83+
1. write release notes to `releases/release-<version>.rst` file. It must include at least version (the first line) and release date (the last line).
84+
1. run `./gradlew clean cli site check releaseCheck`.
85+
1. make a release branch. `git checkout -b release_v<version>` and commit.
86+
1. push the release branch to origin and create a PR.
87+
1. after the PR is merged to master, checkout master and pull latest upstream/master.
88+
1. run `./gradlew clean cli site check releaseCheck` again.
89+
1. if it succeeded, run `./gradlew release`.
90+
1. a few minutes later, run `digdag selfupdate` and confirm the version.
9591

9692
If major version is incremented, also update `version =` and `release =` at [digdag-docs/src/conf.py](digdag-docs/src/conf.py).
9793

94+
If you are expert, skip 5. to 7. and directly update master branch.
95+
96+
### Post-process of new release
97+
98+
You also need following steps after new version has been released.
99+
100+
1. create a tag `git tag -a v<version>` and push `git push upstream v<version>`
101+
1. create a release in [GitHub releases](https://github.com/treasure-data/digdag/releases).
102+
1. create next snapshot version, run `./gradlew setVersion -Pto=<next-version>-SNAPSHOT`.
103+
1. push to master.
104+
98105

99106
### Releasing a SNAPSHOT version
100107

101108
```
102109
./gradlew releaseSnapshot
103110
```
104111

105-
106112
### Develop digdag-ui
107113

108114
Node.js development server is useful because it reloads changes of digdag-ui source code automatically.
@@ -125,17 +131,44 @@ $ npm install
125131
$ npm run dev # starts dev server on http://localhost:9000/
126132
```
127133

134+
### Updating REST API document
135+
136+
Run this command to update REST API document file at digdag-docs/src/api/swagger.yaml.
137+
138+
```
139+
./gradlew swaggerYaml # dump swagger.yaml file
140+
```
141+
142+
Use `--enable-swagger` option to check the current Digdag REST API.
143+
144+
```
145+
$ ./gradlew cli
146+
$ ./pkg/digdag-<current version>.jar server --memory --enable-swagger # Run server with --enable-swagger option
147+
148+
$ docker run -dp 8080:8080 swaggerapi/swagger-ui # Run Swagger-UI on different console
149+
$ open http://localhost:8080/?url=http://localhost:65432/api/swagger.json # Open api/swagger.json on Swagger-UI
150+
```
128151

129152
### Updating documents
130153

131154
Documents are in digdag-docs/src directory. They're built using Sphinx.
132155

133156
Website is hosted on [www.digdag.io](http://www.digdag.io) using Github Pages. Pages are built using deployment step of circle.yml and automatically pushed to [gh-pages branch of digdag-docs repository](https://github.com/treasure-data/digdag-docs/tree/gh-pages).
134157

135-
To build the pages and check them locally, run following command:
158+
To build the pages and check them locally, follow this instruction.
159+
160+
Create a virtual environment of Python and install dependent Python libraries including Sphinx.
161+
162+
```
163+
$ python3 -m venv .venv
164+
$ source .venv/bin/activate
165+
(.venv)$ pip install -r digdag-docs/requirements.txt -c digdag-docs/constraints.txt
166+
```
167+
168+
After installation of Python libraries, You can build with running the following command:
136169

137170
```
138-
$ ./gradlew site
171+
(.venv)$ ./gradlew site
139172
```
140173

141174
This might not always update all necessary files (Sphinx doesn't manage update dependencies well). In this case, run `./gradlew clean` first.
@@ -153,7 +186,7 @@ The list of release note is [here](https://github.com/treasure-data/digdag/tree/
153186
Digdag is using a Java annotation processor `org.immutables:value.` The combination of Java annotation processing and Gradle on IntelliJ IDEA sometimes introduces some troubles. In Digdag's case, you may run into some compile errors like `cannot find symbol: class ImmutableRestWorkflowDefinitionCollection.`
154187
So we'd recommend the followings to avoid those compile errors if you want to develop Digdag one the IDE.
155188

156-
1. There's an important configuration option to be enabled to fully have IntelliJ be fully integrated with an existing gradle build configuration: `Delegate IDE build/run actions to gradle` needs to be enabled.
189+
1. There's an important configuration option to be enabled to fully have IntelliJ be fully integrated with an existing gradle build configuration: `Delegate IDE build/run actions to gradle` needs to be enabled.
157190

158191
![](https://user-images.githubusercontent.com/17990895/48221255-9706be80-e35f-11e8-8283-1ca6d713e31c.png)
159192

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ environment:
1818
- JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0
1919

2020
install:
21-
- ps: Install-Product node '8'
21+
- ps: Install-Product node '12'
2222
- node --version
2323
- npm --version
2424

build.gradle

+29-16
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
2-
id 'com.github.johnrengelman.shadow' version '4.0.4'
3-
id 'com.jfrog.bintray' version '1.8.4'
2+
id 'com.github.johnrengelman.shadow' version '2.0.3'
3+
id 'com.jfrog.bintray' version '1.8.1'
44
id 'com.github.kt3k.coveralls' version '2.6.3'
5-
id 'com.github.spotbugs' version '1.6.9'
5+
id 'com.github.spotbugs' version '1.6.2'
66
id 'net.ltgt.apt-idea' version '0.19'
77
}
88

@@ -12,7 +12,7 @@ apply plugin: 'maven'
1212

1313
allprojects {
1414
group = 'io.digdag'
15-
version = '0.9.33'
15+
version = '0.9.41-SNAPSHOT'
1616

1717
ext {
1818
isSnapshotRelease = version.endsWith('-SNAPSHOT')
@@ -110,17 +110,18 @@ subprojects {
110110
}
111111

112112
ext {
113-
jacksonVersion = "2.8.11"
113+
jacksonVersion = "2.9.9"
114+
jacksonDatabindVersion = "2.9.9"
114115
awsJavaSdkVersion = "1.11.63"
115-
guavaVersion = "19.0"
116+
guavaVersion = "27.1-jre"
116117
}
117118

118119
tasks.withType(JavaCompile) {
119120
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
120121
}
121122

122123
spotbugs {
123-
toolVersion = '3.1.11'
124+
toolVersion = '3.1.5'
124125
effort = 'max'
125126
reportLevel = 'high'
126127
ignoreFailures = true
@@ -137,7 +138,7 @@ subprojects {
137138
jacocoTestReport {
138139
// exclude classes generated by Immutables
139140
afterEvaluate {
140-
classDirectories.from = files(classDirectories.files.collect {
141+
classDirectories = files(classDirectories.files.collect {
141142
fileTree(dir: it, exclude: ['**/Immutable*'])
142143
})
143144
}
@@ -286,19 +287,19 @@ subprojects {
286287

287288
jacocoTestReport {
288289
dependsOn = subprojects.test
289-
sourceDirectories.from = files(subprojects.sourceSets.main.allSource.srcDirs)
290-
classDirectories.from = files(subprojects.sourceSets.main.output)
291-
executionData.from = files(subprojects.jacocoTestReport.executionData)
290+
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
291+
classDirectories = files(subprojects.sourceSets.main.output)
292+
executionData = files(subprojects.jacocoTestReport.executionData)
292293
reports {
293294
xml.enabled = true
294295
html.enabled = true
295296
}
296297
onlyIf = { true }
297298
doFirst {
298-
executionData.from = files(executionData.findAll { it.exists() })
299+
executionData = files(executionData.findAll { it.exists() })
299300
}
300301
afterEvaluate {
301-
classDirectories.from = files(classDirectories.files.collect {
302+
classDirectories = files(classDirectories.files.collect {
302303
fileTree(dir: it, exclude: ['**/Immutable*'])
303304
})
304305
}
@@ -311,7 +312,7 @@ coveralls {
311312

312313
wrapper {
313314
// Find the latest version at https://gradle.org/releases/
314-
gradleVersion = '5.2'
315+
gradleVersion = '4.8'
315316
}
316317

317318
project(':digdag-ui') {
@@ -321,7 +322,8 @@ project(':digdag-ui') {
321322

322323
doFirst {
323324
exec {
324-
commandLine System.env.NPM ?: "npm", "install"
325+
// npm ci requires npm version 5.7 or more.
326+
commandLine System.env.NPM ?: "npm", "ci"
325327
}
326328
exec {
327329
commandLine System.env.NPM ?: "npm", "run", "build"
@@ -394,7 +396,7 @@ task cli(dependsOn: ':digdag-cli:shadowJar') {
394396
file('pkg').mkdirs()
395397
cliBuildFile.write("")
396398
cliBuildFile.append(file("digdag-cli/src/main/sh/selfrun.sh").readBytes())
397-
cliBuildFile.append(file("digdag-cli/build/libs/digdag-cli-${project.version}.jar").readBytes())
399+
cliBuildFile.append(file("digdag-cli/build/libs/digdag-cli-${project.version}-all.jar").readBytes())
398400
cliBuildFile.setExecutable(true)
399401
}
400402
}
@@ -406,6 +408,17 @@ task classpath(dependsOn: [':digdag-cli:classpath']){
406408
}
407409
}
408410

411+
task swaggerYaml(dependsOn: ':digdag-cli:shadowJar') {
412+
doLast {
413+
file("config/dummy.properties").write("")
414+
Process server = ["java", "-jar", "digdag-cli/build/libs/digdag-cli-${project.version}-all.jar", "server", "-c", "config/dummy.properties", "--memory", "--enable-swagger"].execute()
415+
sleep(5 * 1000)
416+
["curl", "http://127.0.0.1:65432/api/swagger.yaml", "-o", "digdag-docs/src/_extra/api/swagger.yaml"].execute().waitFor()
417+
server.destroy()
418+
server.waitForOrKill(1000)
419+
}
420+
}
421+
409422
clean {
410423
delete 'classpath'
411424
delete 'pkg'

ci/run_td_tests.sh

+11-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ idleTimeout = 10
1111
minimumPoolSize = 0
1212
"
1313

14+
echo "---TARGET test ---"
15+
target_src=`circleci tests glob "digdag-tests/src/test/java/acceptance/td/**/*IT.java" | circleci tests split --split-by=timings`
16+
echo $target_src | xargs -n 1 echo
17+
echo "------------------"
18+
19+
1420
export CI_ACCEPTANCE_TEST=true
1521

16-
./gradlew clean cleanTest test --info --no-daemon -p digdag-tests --tests 'acceptance.td.*'
22+
./gradlew clean cleanTest test --info --no-daemon -p digdag-tests --tests 'acceptance.td.*' \
23+
-PtestFilter="$target_src"
24+
# -PtestFilter='`circleci tests glob "digdag-tests/src/test/java/acceptance/td/**/*.java" | circleci tests split --split-by=timings`'
25+
26+

ci/run_test_docker.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash -xe
22

33
docker run \
4+
-v /var/run/docker.sock:/var/run/docker.sock \
45
-w /digdag \
56
-v `pwd`/:/digdag \
67
-v ~/.gradle:/root/.gradle \

digdag-cli/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ dependencies {
1414
// This line is for including digdag-storage-s3 in CLI (shadow jar) used through
1515
// dynamic class loading. digdag-cli itself doesn't depend on digdag-storage-s3.
1616
compile project(':digdag-storage-s3')
17+
compile project(':digdag-storage-gcs')
1718
}

0 commit comments

Comments
 (0)