-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable eru core to make use of eru systemd runtime (#418)
* use docker systemd engine to replace ssh engine * refactor systemd engine Co-authored-by: nyanpassu <[email protected]> Co-authored-by: CMGS <[email protected]>
- Loading branch information
1 parent
582a6f0
commit 7f382e2
Showing
13 changed files
with
73 additions
and
626 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
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,26 @@ | ||
package systemd | ||
|
||
import ( | ||
"context" | ||
"encoding/json" | ||
|
||
"github.com/projecteru2/core/engine/docker" | ||
enginetypes "github.com/projecteru2/core/engine/types" | ||
) | ||
|
||
// VirtualizationCreate create a workload | ||
func (e *Engine) VirtualizationCreate(ctx context.Context, opts *enginetypes.VirtualizationCreateOptions) (*enginetypes.VirtualizationCreated, error) { // nolintlint | ||
rArgs := &docker.RawArgs{StorageOpt: map[string]string{}} | ||
if len(opts.RawArgs) > 0 { | ||
if err := json.Unmarshal(opts.RawArgs, rArgs); err != nil { | ||
return nil, err | ||
} | ||
} | ||
rArgs.Runtime = e.config.Systemd.Runtime | ||
b, err := json.Marshal(rArgs) | ||
if err != nil { | ||
return nil, err | ||
} | ||
opts.RawArgs = b | ||
return e.API.VirtualizationCreate(ctx, opts) | ||
} |
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
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,12 @@ | ||
package systemd | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/projecteru2/core/types" | ||
) | ||
|
||
// ResourceValidate validates resources | ||
func (e *Engine) ResourceValidate(ctx context.Context, cpu float64, cpumap map[string]int64, memory, storage int64) (err error) { | ||
return types.ErrEngineNotImplemented | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.