Skip to content

Commit

Permalink
Make container_vm the default image type
Browse files Browse the repository at this point in the history
The default makes scripts more backwards compatible, since the default
image is still kinda broken. See issue #58 for discussion.
  • Loading branch information
smondet committed Jun 6, 2017
1 parent 4437772 commit a8dcff0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/lib/command_line.ml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ let main () =
(i_need gke_name "A cluster-name is required for GKE clusters.")
~zone:(i_need gzone "A GCloud-zone name is required for GKE clusters.")
~max_nodes
?image_type
~image_type:(
Option.value_map image_type ~default:`Default ~f:(fun s -> `Set s)
)
?machine_type
|> Cluster.gke
| `Local_docker ->
Expand Down
6 changes: 4 additions & 2 deletions src/lib/gke_cluster.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type t = {
min_nodes: int [@default 1];
max_nodes: int;
machine_type: string [@default "n1-highmem-8"];
image_type: string option;
image_type: [ `Set of string | `Default] [@default (`Set "container_vm")];
} [@@deriving yojson, show, make]

let save ~storage:st cluster =
Expand Down Expand Up @@ -39,7 +39,9 @@ let max_started_jobs cluster =
let gcloud_start ~log t =
let cmd =
let image_type_option =
Option.value_map t.image_type ~default:"" ~f:(sprintf "--image-type=%s")
match t.image_type with
| `Default -> ""
| `Set i -> sprintf "--image-type=%s" i
in
sprintf
"gcloud container clusters create %s %s \
Expand Down
4 changes: 2 additions & 2 deletions src/lib/gke_cluster.mli
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ type t = private {
min_nodes : int;
max_nodes : int;
machine_type : string;
image_type: string option;
image_type: [ `Set of string | `Default] [@default (`Set "container_vm")];
} [@@deriving yojson, show]

val make :
zone:string ->
?min_nodes:int -> max_nodes:int ->
?machine_type: string ->
?image_type: string ->
?image_type: [ `Set of string | `Default] ->
string -> t

val max_started_jobs: t -> int
Expand Down

0 comments on commit a8dcff0

Please sign in to comment.