未验证 提交 19ae82bd 编写于 作者: S stormgbs 提交者: GitHub

Merge pull request #127 from hustliyilin/lyl-ra

shim: add the skeleton Enclave Runtime carrier.
......@@ -10,6 +10,7 @@ const (
Empty CarrierKind = ""
Occlum CarrierKind = "occlum"
Graphene CarrierKind = "graphene"
Skeleton CarrierKind = "skeleton"
)
var ErrorUnknownCarrier = errors.New("unknown carrier")
......@@ -141,7 +141,7 @@ func getCarrierKind(bundlePath string) (found bool, value rune.CarrierKind, err
return
}
value = rune.CarrierKind(v)
if value == rune.Occlum || value == rune.Graphene || value == rune.Empty {
if value == rune.Occlum || value == rune.Graphene || value == rune.Empty || value == rune.Skeleton {
found = true
return
}
......
......@@ -30,6 +30,7 @@ import (
"syscall"
"time"
"github.com/alibaba/inclavare-containers/shim/runtime/v2/rune"
"github.com/alibaba/inclavare-containers/shim/runtime/v2/rune/constants"
"github.com/containerd/cgroups"
eventstypes "github.com/containerd/containerd/api/events"
......@@ -307,13 +308,20 @@ func (s *service) Create(ctx context.Context, r *taskAPI.CreateTaskRequest) (_ *
return nil, err
}
carr, err := s.carrierMain(r)
_, carrierKind, err := getCarrierKind(r.Bundle)
if err != nil {
return nil, err
}
if carrierKind != rune.Skeleton {
carr, err := s.carrierMain(r)
if err != nil {
return nil, err
}
logrus.Infof("Carrier: %v", carr.Name())
}
data, _ := json.Marshal(r)
logrus.Infof("CreateTaskRequest: %s, Carrier: %v", string(data), carr.Name())
logrus.Infof("CreateTaskRequest: %s", string(data))
container, err := runc.NewContainer(ctx, s.platform, r)
if err != nil {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册