Skip to content

Commit

Permalink
Add v0.8.2 to docs and add bulkloader to the list of binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawan Rawal committed Sep 20, 2017
1 parent ea1fa3f commit 185136c
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 13 deletions.
1 change: 1 addition & 0 deletions cmd/bulkloader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type options struct {
SkipMapPhase bool
CleanupTmp bool
NumShufflers int
Version bool

MapShards int
ReduceShards int
Expand Down
4 changes: 4 additions & 0 deletions cmd/bulkloader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ func main() {
flag.IntVar(&opt.NumShufflers, "shufflers", 1, "Number of shufflers to run concurrently.")
flag.IntVar(&opt.MapShards, "map_shards", 1, "Number of map output shards.")
flag.IntVar(&opt.ReduceShards, "reduce_shards", 1, "Number of shuffle output shards.")
flag.BoolVar(&opt.Version, "version", false, "Prints the version of bulkloader.")

flag.Parse()
if len(flag.Args()) != 0 {
flag.Usage()
fmt.Fprintf(os.Stderr, "No free args allowed, but got: %v\n", flag.Args())
os.Exit(1)
}
if opt.Version {
x.PrintVersionOnly()
}
if opt.RDFDir == "" || opt.SchemaFile == "" {
flag.Usage()
fmt.Fprint(os.Stderr, "RDF and schema file(s) must be specified.\n")
Expand Down
4 changes: 3 additions & 1 deletion cmd/dgraph/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ func setupConfigOpts() {
}
// Lets check version flag before we SetConfiguration because we validate AllottedMemory in
// SetConfiguration.
x.PrintVersionOnly()
if x.Config.Version {
x.PrintVersionOnly()
}

dgraph.SetConfiguration(config)
}
Expand Down
5 changes: 4 additions & 1 deletion cmd/dgraphloader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ var (
tlsSystemCACerts = flag.Bool("tls.use_system_ca", false, "Include System CA into CA Certs.")
tlsMinVersion = flag.String("tls.min_version", "TLS11", "TLS min version.")
tlsMaxVersion = flag.String("tls.max_version", "TLS12", "TLS max version.")
version = flag.Bool("version", false, "Prints the version of Dgraphloader")
)

// Reads a single line from a buffered reader. The line is read into the
Expand Down Expand Up @@ -251,7 +252,9 @@ func fileList(files string) []string {

func main() {
flag.Parse()
x.Init()
if *version {
x.PrintVersionOnly()
}
runtime.SetBlockProfileRate(*blockRate)

interruptChan := make(chan os.Signal)
Expand Down
5 changes: 5 additions & 0 deletions contrib/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,9 @@ cd $dgraph_cmd/dgraphloader && \
go build -ldflags \
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" .;

echo "bulkloader"
cd $dgraph_cmd/bulkloader && \
go build -ldflags \
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" .;


16 changes: 12 additions & 4 deletions contrib/releases/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,25 @@ uiDir="main.uiDir"
echo -e "\033[1;33mBuilding binaries\033[0m"
echo "dgraph"
cd $dgraph_cmd/dgraph && \
go build -v -ldflags \
go build -ldflags \
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime' -X $uiDir=$ui" .;
echo "dgraphloader"
cd $dgraph_cmd/dgraphloader && \
go build -v -ldflags \
go build -ldflags \
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" .;
echo "bulkloader"
cd $dgraph_cmd/bulkloader && \
go build -ldflags \
"-X $release=$release_version -X $branch=$gitBranch -X $commitSHA1=$lastCommitSHA1 -X '$commitTime=$lastCommitTime'" .;


echo -e "\n\033[1;33mCopying binaries to tmp folder\033[0m"
cd $tmp_dir;
mkdir dgraph && pushd &> /dev/null dgraph;
# Stripping the binaries.
strip $dgraph_cmd/dgraph/dgraph $dgraph_cmd/dgraphloader/dgraphloader;
cp $dgraph_cmd/dgraph/dgraph $dgraph_cmd/dgraphloader/dgraphloader .;
strip $dgraph_cmd/dgraph/dgraph $dgraph_cmd/dgraphloader/dgraphloader \
$dgraph_cmd/bulkloader/bulkloader;
cp $dgraph_cmd/dgraph/dgraph $dgraph_cmd/dgraphloader/dgraphloader $dgraph_cmd/bulkloader/bulkloader .;

echo -e "\n\033[1;34mSize of files after strip: $(du -sh)\033[0m"

Expand All @@ -76,6 +82,8 @@ checksum=$($digest_cmd dgraph | awk '{print $1}')
echo "$checksum /usr/local/bin/dgraph" >> $checksum_file
checksum=$($digest_cmd dgraphloader | awk '{print $1}')
echo "$checksum /usr/local/bin/dgraphloader" >> $checksum_file
checksum=$($digest_cmd bulkloader | awk '{print $1}')
echo "$checksum /usr/local/bin/bulkloader" >> $checksum_file

echo -e "\n\033[1;33mCreating tar file\033[0m"
tar_file=dgraph-"$platform"-amd64-$release_version
Expand Down
3 changes: 2 additions & 1 deletion wiki/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ HOST=https://docs.dgraph.io
# append '(latest)' to the version string, and build script can place the
# artifact in an appropriate location
VERSIONS_ARRAY=(
'v0.8.1'
'v0.8.2'
'master'
'v0.8.1'
'v0.8.0'
'v0.7.7'
'v0.7.6'
Expand Down
10 changes: 4 additions & 6 deletions x/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,15 @@ Branch : %v`,

// PrintVersionOnly prints version and other helpful information if --version.
func PrintVersionOnly() {
if Config.Version {
printBuildDetails()
fmt.Println("Copyright 2017 Dgraph Labs, Inc.")
fmt.Println(`
printBuildDetails()
fmt.Println("Copyright 2017 Dgraph Labs, Inc.")
fmt.Println(`
Licensed under AGPLv3.
For Dgraph official documentation, visit https://docs.dgraph.io.
For discussions about Dgraph , visit https://discuss.dgraph.io.
To say hi to the community , visit https://dgraph.slack.com.
`)
os.Exit(0)
}
os.Exit(0)
}

func Version() string {
Expand Down

0 comments on commit 185136c

Please sign in to comment.