You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2015/12/18 23:40:16 UTC

[2/9] mesos git commit: Added docker v1 manifest protobuf message.

Added docker v1 manifest protobuf message.

Review: https://reviews.apache.org/r/41488/


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/6fc8f815
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/6fc8f815
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/6fc8f815

Branch: refs/heads/master
Commit: 6fc8f815791d2d6bc5950e6c40ce2c52e0942adb
Parents: 496fe2b
Author: Gilbert Song <so...@gmail.com>
Authored: Fri Dec 18 14:13:38 2015 -0800
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri Dec 18 14:29:59 2015 -0800

----------------------------------------------------------------------
 src/Makefile.am                                 |  3 +
 .../mesos/provisioner/docker/message.hpp        |  1 +
 .../mesos/provisioner/docker/v1.proto           | 70 ++++++++++++++++++++
 3 files changed, 74 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/6fc8f815/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 8c4a613..08ee83c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -210,6 +210,8 @@ CXX_PROTOS +=								\
   messages/messages.pb.h						\
   slave/containerizer/mesos/provisioner/docker/message.pb.cc		\
   slave/containerizer/mesos/provisioner/docker/message.pb.h		\
+  slave/containerizer/mesos/provisioner/docker/v1.pb.cc		\
+  slave/containerizer/mesos/provisioner/docker/v1.pb.h		\
   slave/containerizer/mesos/provisioner/docker/v2.pb.cc		\
   slave/containerizer/mesos/provisioner/docker/v2.pb.h
 
@@ -533,6 +535,7 @@ libmesos_no_3rdparty_la_SOURCES =					\
   messages/flags.proto							\
   messages/messages.proto						\
   slave/containerizer/mesos/provisioner/docker/message.proto		\
+  slave/containerizer/mesos/provisioner/docker/v1.proto		\
   slave/containerizer/mesos/provisioner/docker/v2.proto
 
 # TODO(tillt): Remove authentication/cram_md5/* which will enable us to

http://git-wip-us.apache.org/repos/asf/mesos/blob/6fc8f815/src/slave/containerizer/mesos/provisioner/docker/message.hpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/docker/message.hpp b/src/slave/containerizer/mesos/provisioner/docker/message.hpp
index 4554412..5c07143 100644
--- a/src/slave/containerizer/mesos/provisioner/docker/message.hpp
+++ b/src/slave/containerizer/mesos/provisioner/docker/message.hpp
@@ -21,6 +21,7 @@
 
 // ONLY USEFUL AFTER RUNNING PROTOC.
 #include "slave/containerizer/mesos/provisioner/docker/message.pb.h"
+#include "slave/containerizer/mesos/provisioner/docker/v1.pb.h"
 #include "slave/containerizer/mesos/provisioner/docker/v2.pb.h"
 
 namespace mesos {

http://git-wip-us.apache.org/repos/asf/mesos/blob/6fc8f815/src/slave/containerizer/mesos/provisioner/docker/v1.proto
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/mesos/provisioner/docker/v1.proto b/src/slave/containerizer/mesos/provisioner/docker/v1.proto
new file mode 100644
index 0000000..5aec78b
--- /dev/null
+++ b/src/slave/containerizer/mesos/provisioner/docker/v1.proto
@@ -0,0 +1,70 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you 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.
+
+import "mesos/mesos.proto";
+
+package mesos.internal.slave.docker.v1;
+
+/**
+ * Protobuf for the Docker v1 image manifest JSON schema:
+ * https://github.com/docker/docker/blob/master/image/spec/v1.md
+ */
+message ImageManifest {
+  // Following docker code to define and order protobuf fields.
+  // https://github.com/docker/docker/blob/master/image/image.go
+  optional string id = 1;
+  optional string parent = 2;
+
+  // This field is used to comment user added comment. It is not
+  // covered in docker v1 doc, but it is included in docker code.
+  optional string comment = 3;
+
+  optional string created = 4;
+
+  // Container is the id of the container used to commit. It is
+  // not covered in docker v1 doc, but included in docker code.
+  optional string container = 5;
+
+  // TODO(gilbert): Add other config fields.
+  // Currently necessary rumtime config fields only. Please see:
+  // https://github.com/docker/docker/blob/master/runconfig/config.go
+  message Config {
+    optional string Hostname = 1;
+    repeated string Entrypoint = 2;
+    repeated string Env = 3;
+    optional string User = 4;
+    repeated string Cmd = 5;
+    optional string WorkingDir = 6;
+    optional string Volumes = 7;
+
+    // Name of the image as it was passed by the operator.
+    optional string Image = 8;
+
+    // TODO(gilbert): Create a message including string-message
+    // pair to match ExposedPoarts' map (map[nat.Port]struct{}).
+  }
+
+  optional Config container_config = 6;
+
+  optional string docker_version = 7;
+  optional string author = 8;
+
+  optional Config config = 9;
+
+  optional string architecture = 10;
+  optional string os = 11;
+  optional uint32 Size = 12;
+}