Skip to content

Commit

Permalink
Merge pull request #64 from datacol-io/feature/deploy-pods
Browse files Browse the repository at this point in the history
Support for updating all pod types on deployment
  • Loading branch information
dinesh committed Feb 26, 2018
2 parents 2a92f2e + 84042a4 commit 8d96dc4
Show file tree
Hide file tree
Showing 25 changed files with 373 additions and 331 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

216 changes: 112 additions & 104 deletions api/controller/services.pb.go

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions api/controller/services.proto
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ message LogStreamReq {
string name = 1;
bool follow = 2;
google.protobuf.Duration since = 3;
string proctype = 4;
}

message ProcessRunReq {
Expand Down
9 changes: 9 additions & 0 deletions api/controller/services.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,12 @@
"required": false,
"type": "integer",
"format": "int32"
},
{
"name": "proctype",
"in": "query",
"required": false,
"type": "string"
}
],
"tags": [
Expand Down Expand Up @@ -1040,6 +1046,9 @@
"name": {
"type": "string"
},
"proctype": {
"type": "string"
},
"workers": {
"type": "integer",
"format": "int32"
Expand Down
5 changes: 3 additions & 2 deletions api/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ func (s *Server) LogStream(req *pbs.LogStreamReq, stream pbs.ProviderService_Log
}

return s.Provider.LogStream(req.Name, logStreamW{stream}, pb.LogStreamOptions{
Follow: req.Follow,
Since: since,
Follow: req.Follow,
Since: since,
Proctype: req.Proctype,
})
}

Expand Down
5 changes: 3 additions & 2 deletions api/models/extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ type ReleaseOptions struct {
}

type LogStreamOptions struct {
Follow bool
Since time.Duration
Follow bool
Proctype string
Since time.Duration
}

type AppCreateOptions struct {
Expand Down
174 changes: 111 additions & 63 deletions api/models/types.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions api/models/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ message EnvConfig {

message Process {
string name = 1;
int32 workers = 2;
string status = 3;
string proctype = 2;
int32 workers = 3;
string status = 4;
}

message Formation {
Expand Down
10 changes: 5 additions & 5 deletions client/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ func (c *Client) RestartApp(name string) error {
return err
}

func (c *Client) StreamAppLogs(name string, follow bool, since time.Duration, out io.Writer) error {
func (c *Client) StreamAppLogs(name string, follow bool, since time.Duration, proctype string, out io.Writer) error {
stream, err := c.ProviderServiceClient.LogStream(ctx, &pbs.LogStreamReq{
Name: name,
Since: ptypes.DurationProto(since),
Follow: follow,
Name: name,
Since: ptypes.DurationProto(since),
Follow: follow,
Proctype: proctype,
})
if err != nil {
return err
}

defer stream.CloseSend()

for {
Expand Down
12 changes: 1 addition & 11 deletions cloud/aws/apps.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,23 +96,13 @@ func (a *AwsCloud) AppGet(name string) (*pb.App, error) {
return nil, err
}

// FIXME: Have a better way to determine name for the deployed service(s). This will change if we support multiple processes for an app.
var proctype string
if len(b.Procfile) > 0 {
proctype = "web"
} else {
proctype = "cmd"
}

kc := a.kubeClient()
proctype, kc := common.GetDefaultProctype(b), a.kubeClient()
serviceName := common.GetJobID(name, proctype)

if app.Endpoint, err = sched.GetServiceEndpoint(kc, a.DeploymentName, serviceName); err != nil {
return app, err
}

return app, a.saveApp(app)

}

return app, nil
Expand Down
Loading

0 comments on commit 8d96dc4

Please sign in to comment.