From 31270bba69dbc95a75b46ac7e778bcd9da312341 Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Tue, 26 Apr 2016 11:53:47 -0700 Subject: [PATCH] Remove windows files Windows is not going to use containerd because there is already a similar implementation on windows. This removes all the windows files because there is no reason to keep this overhead when its not going to be used. Signed-off-by: Michael Crosby --- api/grpc/server/server_windows.go | 39 --------------------- osutils/windows.go | 9 ----- runtime/process_windows.go | 29 ---------------- runtime/runtime_windows.go | 10 ------ specs/spec_windows.go | 56 ------------------------------- supervisor/create_windows.go | 8 ----- supervisor/machine_windows.go | 5 --- supervisor/monitor_windows.go | 34 ------------------- supervisor/supervisor_windows.go | 33 ------------------ 9 files changed, 223 deletions(-) delete mode 100644 api/grpc/server/server_windows.go delete mode 100644 osutils/windows.go delete mode 100644 runtime/process_windows.go delete mode 100644 runtime/runtime_windows.go delete mode 100644 specs/spec_windows.go delete mode 100644 supervisor/create_windows.go delete mode 100644 supervisor/machine_windows.go delete mode 100644 supervisor/monitor_windows.go delete mode 100644 supervisor/supervisor_windows.go diff --git a/api/grpc/server/server_windows.go b/api/grpc/server/server_windows.go deleted file mode 100644 index 96b34e7c6..000000000 --- a/api/grpc/server/server_windows.go +++ /dev/null @@ -1,39 +0,0 @@ -package server - -import ( - "errors" - - "github.com/docker/containerd/api/grpc/types" - "github.com/docker/containerd/specs" - "github.com/docker/containerd/supervisor" - "golang.org/x/net/context" -) - -// noop on Windows (Checkpoints not supported) -func createContainerConfigCheckpoint(e *supervisor.StartTask, c *types.CreateContainerRequest) { -} - -// TODO Windows - may be able to completely factor out -func (s *apiServer) CreateCheckpoint(ctx context.Context, r *types.CreateCheckpointRequest) (*types.CreateCheckpointResponse, error) { - return nil, errors.New("CreateCheckpoint() not supported on Windows") -} - -// TODO Windows - may be able to completely factor out -func (s *apiServer) DeleteCheckpoint(ctx context.Context, r *types.DeleteCheckpointRequest) (*types.DeleteCheckpointResponse, error) { - return nil, errors.New("DeleteCheckpoint() not supported on Windows") -} - -// TODO Windows - may be able to completely factor out -func (s *apiServer) ListCheckpoint(ctx context.Context, r *types.ListCheckpointRequest) (*types.ListCheckpointResponse, error) { - return nil, errors.New("ListCheckpoint() not supported on Windows") -} - -func (s *apiServer) Stats(ctx context.Context, r *types.StatsRequest) (*types.StatsResponse, error) { - return nil, errors.New("Stats() not supported on Windows") -} - -func setUserFieldsInProcess(p *types.Process, oldProc specs.ProcessSpec) { -} - -func setPlatformRuntimeProcessSpecUserFields(r *types.User, process *specs.ProcessSpec) { -} diff --git a/osutils/windows.go b/osutils/windows.go deleted file mode 100644 index 4908c05a8..000000000 --- a/osutils/windows.go +++ /dev/null @@ -1,9 +0,0 @@ -// +build windows - -package osutils - -// GetOpenFds returns the number of open fds for the process provided by pid -// Not supported on Windows (same as for docker daemon) -func GetOpenFds(pid int) (int, error) { - return -1, nil -} diff --git a/runtime/process_windows.go b/runtime/process_windows.go deleted file mode 100644 index e43535246..000000000 --- a/runtime/process_windows.go +++ /dev/null @@ -1,29 +0,0 @@ -package runtime - -import "os" - -// TODO Windows: Linux uses syscalls which don't map to Windows. Needs alternate mechanism -func getExitPipe(path string) (*os.File, error) { - return nil, nil -} - -// TODO Windows: Linux uses syscalls which don't map to Windows. Needs alternate mechanism -func getControlPipe(path string) (*os.File, error) { - return nil, nil -} - -// TODO Windows. Windows does not support signals. Need alternate mechanism -// Signal sends the provided signal to the process -func (p *process) Signal(s os.Signal) error { - return nil -} - -func populateProcessStateForEncoding(config *processConfig, uid int, gid int) ProcessState { - return ProcessState{ - ProcessSpec: config.processSpec, - Exec: config.exec, - Stdin: config.stdio.Stdin, - Stdout: config.stdio.Stdout, - Stderr: config.stdio.Stderr, - } -} diff --git a/runtime/runtime_windows.go b/runtime/runtime_windows.go deleted file mode 100644 index b3d9218bd..000000000 --- a/runtime/runtime_windows.go +++ /dev/null @@ -1,10 +0,0 @@ -package runtime - -// Checkpoint is not supported on Windows. -// TODO Windows: Can eventually be factored out entirely. -type Checkpoint struct { -} - -// PlatformProcessState container platform-specific fields in the ProcessState structure -type PlatformProcessState struct { -} diff --git a/specs/spec_windows.go b/specs/spec_windows.go deleted file mode 100644 index 006a0ef89..000000000 --- a/specs/spec_windows.go +++ /dev/null @@ -1,56 +0,0 @@ -package specs - -// Temporary Windows version of the spec in lieu of opencontainers/runtime-spec/specs-go having -// Windows support currently. - -type ( - PlatformSpec WindowsSpec - ProcessSpec Process -) - -// This is a temporary module in lieu of opencontainers/runtime-spec/specs-go being compatible -// currently on Windows. - -// Process contains information to start a specific application inside the container. -type Process struct { - // Terminal creates an interactive terminal for the container. - Terminal bool `json:"terminal"` - // User specifies user information for the process. - // TEMPORARY HACK User User `json:"user"` - // Args specifies the binary and arguments for the application to execute. - Args []string `json:"args"` - // Env populates the process environment for the process. - Env []string `json:"env,omitempty"` - // Cwd is the current working directory for the process and must be - // relative to the container's root. - Cwd string `json:"cwd"` -} - -type Spec struct { - // Version is the version of the specification that is supported. - Version string `json:"ociVersion"` - // Platform is the host information for OS and Arch. - // TEMPORARY HACK Platform Platform `json:"platform"` - // Process is the container's main process. - Process Process `json:"process"` - // Root is the root information for the container's filesystem. - // TEMPORARY HACK Root Root `json:"root"` - // Hostname is the container's host name. - // TEMPORARY HACK Hostname string `json:"hostname,omitempty"` - // Mounts profile configuration for adding mounts to the container's filesystem. - // TEMPORARY HACK Mounts []Mount `json:"mounts"` - // Hooks are the commands run at various lifecycle events of the container. - // TEMPORARY HACK Hooks Hooks `json:"hooks"` -} - -// Windows contains platform specific configuration for Windows based containers. -type Windows struct { -} - -// TODO Windows - Interim hack. Needs implementing. -type WindowsSpec struct { - Spec - - // Windows is platform specific configuration for Windows based containers. - Windows Windows `json:"windows"` -} diff --git a/supervisor/create_windows.go b/supervisor/create_windows.go deleted file mode 100644 index 2d76396fe..000000000 --- a/supervisor/create_windows.go +++ /dev/null @@ -1,8 +0,0 @@ -package supervisor - -type platformStartTask struct { -} - -// Checkpoint not supported on Windows -func (task *startTask) setTaskCheckpoint(t *StartTask) { -} diff --git a/supervisor/machine_windows.go b/supervisor/machine_windows.go deleted file mode 100644 index 90d47c8ba..000000000 --- a/supervisor/machine_windows.go +++ /dev/null @@ -1,5 +0,0 @@ -package supervisor - -func CollectMachineInformation() (Machine, error) { - return Machine{}, nil -} diff --git a/supervisor/monitor_windows.go b/supervisor/monitor_windows.go deleted file mode 100644 index 71db76e55..000000000 --- a/supervisor/monitor_windows.go +++ /dev/null @@ -1,34 +0,0 @@ -package supervisor - -import ( - "errors" - - "github.com/docker/containerd/runtime" -) - -// TODO Windows: This is going to be very problematic to port to Windows. -// Windows golang has no concept of EpollEvent/EpollCtl etc as in the -// Linux implementation. @crosbymichael - Help needed. - -func NewMonitor() (*Monitor, error) { - // During Windows bring-up, don't error out other binary bombs immediately. - return &Monitor{}, nil -} - -type Monitor struct { -} - -func (m *Monitor) Exits() chan runtime.Process { - return nil -} - -func (m *Monitor) Monitor(p runtime.Process) error { - return errors.New("Monitor not implemented on Windows") -} - -func (m *Monitor) Close() error { - return errors.New("Monitor Close() not implemented on Windows") -} - -func (m *Monitor) start() { -} diff --git a/supervisor/supervisor_windows.go b/supervisor/supervisor_windows.go deleted file mode 100644 index 2882577ea..000000000 --- a/supervisor/supervisor_windows.go +++ /dev/null @@ -1,33 +0,0 @@ -package supervisor - -func (s *Supervisor) handleTask(i Task) { - var err error - switch t := i.(type) { - case *AddProcessTask: - err = s.addProcess(t) - case *StartTask: - err = s.start(t) - case *DeleteTask: - err = s.delete(t) - case *ExitTask: - err = s.exit(t) - case *ExecExitTask: - err = s.execExit(t) - case *GetContainersTask: - err = s.getContainers(t) - case *SignalTask: - err = s.signal(t) - case *StatsTask: - err = s.stats(t) - case *UpdateTask: - err = s.updateContainer(t) - case *UpdateProcessTask: - err = s.updateProcess(t) - default: - err = ErrUnknownTask - } - if err != errDeferredResponse { - i.ErrorCh() <- err - close(i.ErrorCh()) - } -}