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

Merge pull request #127 from hustliyilin/lyl-ra

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