Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

backupccl: add baidu cloud storage GO SDK for cockroachdb/cockroach case #32626 #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yangliang9004
Copy link

No description provided.

@dt
Copy link
Member

dt commented Nov 27, 2018

This change appears to be adding a submodule to vendor -- usually vendor is itself one, big submodule but itself usually just contains checked-in files, as arranged by the tool dep.

There are more docs here on how we manage vendored with dep:https://github.com/cockroachdb/cockroach/blob/2c79ad60cffc05100227fb07d4fbb307a755c08b/build/README.md#updating-dependencies

Basically, the short-answer is in export_storage.go, we'd add an import of github.com/baidubce/bce-sdk-go , then run ./bin/dep ensure and let it make the modifications in vendor, then commit those changes in the vendor that change would be what is in this PR.

@yangliang9004
Copy link
Author

Thanks, I get it.

@yangliang9004
Copy link
Author

@dt Hi , David, yesterday , I have tried as you said , my commands is as follows:

> git  clone https://github.com/yangliang9004/cockroach.git
> cd cockroach
> git remote add upstream https://github.com/cockroachdb/cockroach.git
> git fetch upstream
> git checkout -b backup_to_bos upstream/master
> make build

after these commands, the status is as follows

> git remote -v         
        origin	https://github.com/yangliang9004/cockroach.git (fetch)
        origin	https://github.com/yangliang9004/cockroach.git (push)
        upstream	https://github.com/cockroachdb/cockroach.git (fetch)
        upstream	https://github.com/cockroachdb/cockroach.git (push)

> ls bin
benchstat               go-bindata              optgen.d
crlfmt                  gocovmerge              prereqs
dep                     gofmt                   protoc-gen-gogoroach
docgen                  goimports               protoc-gen-gogoroach.d
docgen.d                golint                  protoc-gen-grpc-gateway
dupl                    goveralls               stress
errcheck                goyacc                  stringer
execgen                 misspell                uptodate
execgen.d               optgen                  uptodate.d

then , I get the tool ./bin/dep and I add my code and execute some commands, the status is :

> git status
	modified:   pkg/ccl/storageccl/export_storage.go
	modified:   pkg/ccl/storageccl/export_storage_test.go
	modified:   pkg/roachpb/api.proto

> make protobuf
> ./bin/dep ensure
> git status
	modified:   Gopkg.lock
	modified:   pkg/ccl/storageccl/export_storage.go
	modified:   pkg/ccl/storageccl/export_storage_test.go
	modified:   pkg/roachpb/api.pb.go
	modified:   pkg/roachpb/api.proto
	modified:   vendor (untracked content)
 
> cd vendor 
> git status
        github.com/baidubce/
> git add github.com/baidubce
> git commit -m "backupccl: add BOS GO SDK to vendor for case #32626 "
> cd .. 
> git add  Gopkg.lock pkg/ccl/storageccl/export_storage.go pkg/ccl/storageccl/export_storage_test.go pkg/roachpb/api.pb.go  pkg/roachpb/api.proto vendor
> git commit -m "backupccl: support to back up data to BOS , for case #32626 "
> git push --set-upstream origin backup_bos

those are what I did to solve this case #32626 , after I pushed my code to github, but I get the error :

[09:06:19][Updating sources] Failed to perform checkout on agent: '/usr/bin/git -c credential.helper= submodule update --force' command failed.
exit code: 1
stdout: Submodule path 'c-deps/cryptopp': checked out 'f0e5b8f6bbd0c2b7b0919faa30659005faaf95c5'
Submodule path 'c-deps/googletest': checked out '59202300f1a774068608caff0351cc084fe79e7c'
Submodule path 'c-deps/jemalloc': checked out '04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5'
Submodule path 'c-deps/protobuf': checked out '20f5237602fa6a2cab91a395effedbff7dd305be'
Submodule path 'c-deps/rocksdb': checked out '7410b3efc991422436764ee503c6e0c5c6965c4b'
Submodule path 'c-deps/snappy': checked out 'b02bfa754ebf27921d8da3bd2517eab445b84ff9'
Submodule path 'pkg/ui/yarn-vendor': checked out '49d798405faa83fa35aaf32052d9f8924184694d'
stderr: Cloning into '/home/agent/work/.go/src/github.com/cockroachdb/cockroach/c-deps/cryptopp'...
Cloning into '/home/agent/work/.go/src/github.com/cockroachdb/cockroach/c-deps/googletest'...
Cloning into '/home/agent/work/.go/src/github.com/cockroachdb/cockroach/c-deps/jemalloc'...
Cloning into '/home/agent/work/.go/src/github.com/cockroachdb/cockroach/c-deps/protobuf'...
Cloning into '/home/agent/work/.go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb'...
Cloning into '/home/agent/work/.go/src/github.com/cockroachdb/cockroach/c-deps/snappy'...
Cloning into '/home/agent/work/.go/src/github.com/cockroachdb/cockroach/pkg/ui/yarn-vendor'...
Cloning into '/home/agent/work/.go/src/github.com/cockroachdb/cockroach/vendor'...
error: Server does not allow request for unadvertised object 5d331c5a1dc92e4163019445f406cc3675c41f5b
Fetched in submodule path 'vendor', but it did not contain 5d331c5a1dc92e4163019445f406cc3675c41f5b. Direct fetching of that commit failed.

5d331c5a1dc92e4163019445f406cc3675c41f5b is the commit Id after I committed in vendor, this error means it could not get the dependence "github.com/baidubce", so I think , Maybe I am wrong somewhere.
I need your help, please give me some advice, thanks !
@dt

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants