Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix issue that push empty logs to logstore and change vendor updating… (
moby#2) * fix issue that push empty logs to logstore and change vendor updating method * update vendor
- Loading branch information
1 parent
979c699
commit 90c18a7
Showing
35 changed files
with
7,239 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,5 +27,4 @@ docs/changed-files | |
man/man1 | ||
man/man5 | ||
man/man8 | ||
vendor/ | ||
vendor/pkg/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
## Update vendor | ||
|
||
* if you need to update dependent package in vendor, you need to add or update package in hack/vendor.sh file, like this: | ||
|
||
``` | ||
clone git github.com/galaxydi/go-loghub 228ca31911b37dd900a5ab9a3fbdc66c2d88ab16 | ||
clone git github.com/cloudflare/golz4 ef862a3cdc58a6f1fee4e3af3d44fbe279194cde | ||
clone git github.com/golang/glog 23def4e6c14b4da8ac2ed8007337bc5eb5007998 | ||
``` | ||
|
||
* if your package use 'import "C"'(use cgo) and has necessary .c and .h files, append the directory which contains only .c and .h files to the parameter "findArgs" in hack/.vendor-helpers.sh like this: | ||
|
||
``` | ||
# lz4 uses cgo and has .c and .h files | ||
findArgs+=( -or -path vendor/src/github.com/cloudflare/golz4/src ) | ||
``` | ||
|
||
* run the command to update vendor | ||
|
||
``` | ||
bash hack/vendor.sh | ||
``` | ||
|
||
* run the command to compile binary | ||
|
||
``` | ||
make bianry | ||
``` | ||
|
||
* you will see the result in | ||
|
||
``` | ||
$ll -rt bundles/* | ||
lrwxrwxrwx 1 yushuting staff 6 Jun 13 17:46 bundles/latest -> 1.12.6 | ||
bundles/1.12.6: | ||
total 0 | ||
drwxr-xr-x 6 yushuting staff 204 Jun 13 17:46 binary-client | ||
drwxr-xr-x 22 yushuting staff 748 Jun 13 17:48 binary-daemon | ||
$ll -rt * | ||
binary-client: | ||
total 30648 | ||
-rw-r--r-- 1 yushuting staff 80 Jun 13 17:46 docker-1.12.6.sha256 | ||
-rw-r--r-- 1 yushuting staff 48 Jun 13 17:46 docker-1.12.6.md5 | ||
-rwxr-xr-x 1 yushuting staff 15675704 Jun 13 17:46 docker-1.12.6 | ||
lrwxrwxrwx 1 yushuting staff 13 Jun 13 17:46 docker -> docker-1.12.6 | ||
binary-daemon: | ||
total 163160 | ||
-rwxr-xr-x 1 yushuting staff 46168368 Jun 13 17:48 dockerd-1.12.6 | ||
-rw-r--r-- 1 yushuting staff 49 Jun 13 17:48 dockerd-1.12.6.md5 | ||
lrwxrwxrwx 1 yushuting staff 14 Jun 13 17:48 dockerd -> dockerd-1.12.6 | ||
-rw-r--r-- 1 yushuting staff 81 Jun 13 17:48 dockerd-1.12.6.sha256 | ||
-rw-r--r-- 1 yushuting staff 86 Jun 13 17:48 docker-proxy-1.12.6.sha256 | ||
-rw-r--r-- 1 yushuting staff 54 Jun 13 17:48 docker-proxy-1.12.6.md5 | ||
-rwxr-xr-x 1 yushuting staff 2879456 Jun 13 17:48 docker-proxy-1.12.6 | ||
lrwxrwxrwx 1 yushuting staff 19 Jun 13 17:48 docker-proxy -> docker-proxy-1.12.6 | ||
-rw-r--r-- 1 yushuting staff 52 Jun 13 17:48 docker-containerd.md5 | ||
-rwxr-xr-x 1 yushuting staff 11291144 Jun 13 17:48 docker-containerd | ||
-rw-r--r-- 1 yushuting staff 84 Jun 13 17:48 docker-containerd.sha256 | ||
-rw-r--r-- 1 yushuting staff 89 Jun 13 17:48 docker-containerd-shim.sha256 | ||
-rw-r--r-- 1 yushuting staff 57 Jun 13 17:48 docker-containerd-shim.md5 | ||
-rwxr-xr-x 1 yushuting staff 3831592 Jun 13 17:48 docker-containerd-shim | ||
-rw-r--r-- 1 yushuting staff 56 Jun 13 17:48 docker-containerd-ctr.md5 | ||
-rwxr-xr-x 1 yushuting staff 10537472 Jun 13 17:48 docker-containerd-ctr | ||
-rw-r--r-- 1 yushuting staff 46 Jun 13 17:48 docker-runc.md5 | ||
-rwxr-xr-x 1 yushuting staff 8764120 Jun 13 17:48 docker-runc | ||
-rw-r--r-- 1 yushuting staff 88 Jun 13 17:48 docker-containerd-ctr.sha256 | ||
-rw-r--r-- 1 yushuting staff 78 Jun 13 17:48 docker-runc.sha256 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Compiled Object files, Static and Dynamic libs (Shared Objects) | ||
*.o | ||
*.a | ||
*.so | ||
|
||
# Folders | ||
_obj | ||
_test | ||
|
||
# Architecture specific extensions/prefixes | ||
*.[568vq] | ||
[568vq].out | ||
|
||
*.cgo1.go | ||
*.cgo2.c | ||
_cgo_defun.c | ||
_cgo_gotypes.go | ||
_cgo_export.* | ||
|
||
_testmain.go | ||
|
||
*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright (c) 2013 CloudFlare, Inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
* Redistributions in binary form must reproduce the above copyright notice, this | ||
list of conditions and the following disclaimer in the documentation and/or | ||
other materials provided with the distribution. | ||
|
||
* Neither the name of the CloudFlare, Inc. nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR | ||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
GCFLAGS := | ||
LDFLAGS := | ||
|
||
.PHONY: install | ||
install: | ||
@go install -v . | ||
|
||
.PHONY: test | ||
test: | ||
@go test -gcflags='$(GCFLAGS)' -ldflags='$(LDFLAGS)' . | ||
|
||
.PHONY: bench | ||
bench: | ||
@go test -gcflags='$(GCFLAGS)' -ldflags='$(LDFLAGS)' -bench . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
golz4 | ||
===== | ||
|
||
Golang interface to LZ4 compression |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Package lz4 implements compression using lz4.c and lz4hc.c | ||
// | ||
// Copyright (c) 2013 CloudFlare, Inc. | ||
package lz4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package lz4 | ||
|
||
// #cgo CFLAGS: -O3 | ||
// #include "src/lz4.h" | ||
// #include "src/lz4.c" | ||
import "C" | ||
|
||
import ( | ||
"errors" | ||
"fmt" | ||
"unsafe" | ||
) | ||
|
||
// p gets a char pointer to the first byte of a []byte slice | ||
func p(in []byte) *C.char { | ||
if len(in) == 0 { | ||
return (*C.char)(unsafe.Pointer(nil)) | ||
} | ||
return (*C.char)(unsafe.Pointer(&in[0])) | ||
} | ||
|
||
// clen gets the length of a []byte slice as a char * | ||
func clen(s []byte) C.int { | ||
return C.int(len(s)) | ||
} | ||
|
||
// Uncompress with a known output size. len(out) should be equal to | ||
// the length of the uncompressed out. | ||
func Uncompress(in, out []byte) (error) { | ||
if int(C.LZ4_decompress_safe(p(in), p(out), clen(in), clen(out))) < 0 { | ||
return errors.New("Malformed compression stream") | ||
} | ||
|
||
return nil | ||
} | ||
|
||
// CompressBound calculates the size of the output buffer needed by | ||
// Compress. This is based on the following macro: | ||
// | ||
// #define LZ4_COMPRESSBOUND(isize) | ||
// ((unsigned int)(isize) > (unsigned int)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16) | ||
func CompressBound(in []byte) int { | ||
return len(in) + ((len(in) / 255) + 16) | ||
} | ||
|
||
// Compress compresses in and puts the content in out. len(out) | ||
// should have enough space for the compressed data (use CompressBound | ||
// to calculate). Returns the number of bytes in the out slice. | ||
func Compress(in, out []byte) (outSize int, err error) { | ||
outSize = int(C.LZ4_compress_limitedOutput(p(in), p(out), clen(in), clen(out))) | ||
if outSize == 0 { | ||
err = fmt.Errorf("insufficient space for compression") | ||
} | ||
return | ||
} |
Oops, something went wrong.