-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-678] Add BuildSpecFactory to container controller
We currently take an io.Reader as a parameter to Controller.Start(). This is relatively inconsequential since the docker tarball is precomputed. However, in the near future, we will be splitting this up so that cds.CodePackage is only a src container. The formulation into a docker container will happen JIT in response to a peer trying to start the container. Once this happens, we want to avoid the overhead of computing the build specification unless it is actually needed. Therefore, we use a callback that the docker-controller may use to indicate when the build-spec is needed. Part of FAB-678 Change-Id: I259c9c0b600866c2b78c4319039ca8214d2a9620 Signed-off-by: Greg Haskins <gregory.haskins@gmail.com>
- Loading branch information
Showing
5 changed files
with
65 additions
and
27 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
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,36 @@ | ||
/* | ||
Copyright IBM Corp. 2017 All Rights Reserved. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package api | ||
|
||
import ( | ||
"io" | ||
|
||
"golang.org/x/net/context" | ||
|
||
"github.com/hyperledger/fabric/core/container/ccintf" | ||
) | ||
|
||
type BuildSpecFactory func() (io.Reader, error) | ||
|
||
//abstract virtual image for supporting arbitrary virual machines | ||
type VM interface { | ||
Deploy(ctxt context.Context, ccid ccintf.CCID, args []string, env []string, reader io.Reader) error | ||
Start(ctxt context.Context, ccid ccintf.CCID, args []string, env []string, builder BuildSpecFactory) error | ||
Stop(ctxt context.Context, ccid ccintf.CCID, timeout uint, dontkill bool, dontremove bool) error | ||
Destroy(ctxt context.Context, ccid ccintf.CCID, force bool, noprune bool) error | ||
GetVMName(ccID ccintf.CCID) (string, error) | ||
} |
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 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