Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enclave manager exposes api's to lock, unlock ports and view their current state #2348

Merged
merged 44 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
65b87c2
update protobuf definition
h4ck3rk3y Mar 26, 2024
3553a2c
updated proto with some new requests
h4ck3rk3y Mar 26, 2024
339bbfa
added a new line at the end
h4ck3rk3y Mar 26, 2024
5c2e6f1
update server api port
h4ck3rk3y Mar 26, 2024
6d341cd
regenerate golang
h4ck3rk3y Mar 26, 2024
23fa61a
change proto
h4ck3rk3y Mar 27, 2024
a8de87f
Merge branch 'main' into gyani/public-ports
h4ck3rk3y Apr 2, 2024
64d1ab3
regenerate backend
h4ck3rk3y Apr 2, 2024
bac4661
update the proto
h4ck3rk3y Apr 2, 2024
9178692
update the proto
h4ck3rk3y Apr 2, 2024
1689e86
genereate again
h4ck3rk3y Apr 2, 2024
6034620
introduced a port message, changed some args/request names
h4ck3rk3y Apr 2, 2024
d47f789
em-backend-changes
h4ck3rk3y Apr 2, 2024
d34a070
work in progress
h4ck3rk3y Apr 2, 2024
5aaf735
ran prettier
h4ck3rk3y Apr 2, 2024
27f1bb1
enclave manager server has some changes to expose lock, unlock port a…
h4ck3rk3y Apr 2, 2024
7b5b920
fix linter
h4ck3rk3y Apr 2, 2024
21b76fb
fix some more linting changes
h4ck3rk3y Apr 2, 2024
bd5be40
make linter happy
h4ck3rk3y Apr 2, 2024
e7a9293
Merge branch 'main' into gyani/em-backend-changes
h4ck3rk3y Apr 4, 2024
104503e
revert cloud changes
h4ck3rk3y Apr 4, 2024
66fd405
added ;
h4ck3rk3y Apr 4, 2024
e5e045e
pass jwt token correctly
h4ck3rk3y Apr 4, 2024
5e5a0ed
make amd64 the default
h4ck3rk3y Apr 5, 2024
fc587cb
work in progress
h4ck3rk3y Apr 5, 2024
62f4e57
ran prettier
h4ck3rk3y Apr 5, 2024
b4cf751
more gpt generated frontend code
h4ck3rk3y Apr 5, 2024
71799b2
fix a bug
h4ck3rk3y Apr 5, 2024
795b366
make icons better again
h4ck3rk3y Apr 5, 2024
87e9b15
more gpt magic
h4ck3rk3y Apr 5, 2024
2b7c7e3
removed tooltip
h4ck3rk3y Apr 5, 2024
473c876
Merge branch 'main' into gyani/em-backend-changes
h4ck3rk3y Apr 5, 2024
ca88890
new commit
h4ck3rk3y Apr 5, 2024
550b2f6
revert arch changes
h4ck3rk3y Apr 5, 2024
f12fd03
slight tweaks before review
h4ck3rk3y Apr 5, 2024
658211e
Improve styles for lock/unlock button
imjuangarcia Apr 5, 2024
749b68f
Improve comma separator between ports in port summary component
imjuangarcia Apr 5, 2024
2c785dc
Improve styles for toast notification
imjuangarcia Apr 5, 2024
e62a67c
Add option to disable port locking on enclave list
imjuangarcia Apr 5, 2024
eefb0c0
ran prettier
h4ck3rk3y Apr 8, 2024
1a9f2ed
Revert "revert arch changes"
h4ck3rk3y Apr 8, 2024
5fedfdf
fixed if condition
h4ck3rk3y Apr 8, 2024
46314b0
slight tweaks before review
h4ck3rk3y Apr 8, 2024
3116635
Revert "Revert "revert arch changes""
h4ck3rk3y Apr 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,402 changes: 707 additions & 695 deletions api/golang/core/kurtosis_core_rpc_api_bindings/api_container_service.pb.go

Large diffs are not rendered by default.

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

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func NewPort(
TransportProtocol: protocol,
MaybeApplicationProtocol: maybeApplicationProtocol,
MaybeWaitTimeout: maybeWaitTimeout,
Locked: nil,
}
}

Expand Down

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

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

3 changes: 3 additions & 0 deletions api/protobuf/core/api_container_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ message Port {
string maybe_application_protocol = 3;
// The wait timeout duration in string
string maybe_wait_timeout = 4;

// this is useful in the cloud context; ignore in local
optional bool locked = 5;
h4ck3rk3y marked this conversation as resolved.
Show resolved Hide resolved
}

message Container {
Expand Down
3 changes: 3 additions & 0 deletions api/rust/src/api_container_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ pub struct Port {
/// The wait timeout duration in string
#[prost(string, tag = "4")]
pub maybe_wait_timeout: ::prost::alloc::string::String,
/// this is useful in the cloud context; ignore in local
#[prost(bool, optional, tag = "5")]
pub locked: ::core::option::Option<bool>,
}
/// Nested message and enum types in `Port`.
pub mod port {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as grpcWeb from 'grpc-web';

import * as api_container_service_pb from './api_container_service_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
import * as api_container_service_pb from './api_container_service_pb'; // proto import: "api_container_service.proto"
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; // proto import: "google/protobuf/empty.proto"


export class ApiContainerServiceClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
// protoc-gen-grpc-web v1.4.2
// protoc-gen-grpc-web v1.5.0
// protoc v3.19.1
// source: api_container_service.proto

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as jspb from 'google-protobuf'

import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; // proto import: "google/protobuf/empty.proto"


export class Port extends jspb.Message {
Expand All @@ -16,6 +16,11 @@ export class Port extends jspb.Message {
getMaybeWaitTimeout(): string;
setMaybeWaitTimeout(value: string): Port;

getLocked(): boolean;
setLocked(value: boolean): Port;
hasLocked(): boolean;
clearLocked(): Port;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): Port.AsObject;
static toObject(includeInstance: boolean, msg: Port): Port.AsObject;
Expand All @@ -30,13 +35,19 @@ export namespace Port {
transportProtocol: Port.TransportProtocol,
maybeApplicationProtocol: string,
maybeWaitTimeout: string,
locked?: boolean,
}

export enum TransportProtocol {
TCP = 0,
SCTP = 1,
UDP = 2,
}

export enum LockedCase {
_LOCKED_NOT_SET = 0,
LOCKED = 5,
}
}

export class Container extends jspb.Message {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,8 @@ proto.api_container_api.Port.toObject = function(includeInstance, msg) {
number: jspb.Message.getFieldWithDefault(msg, 1, 0),
transportProtocol: jspb.Message.getFieldWithDefault(msg, 2, 0),
maybeApplicationProtocol: jspb.Message.getFieldWithDefault(msg, 3, ""),
maybeWaitTimeout: jspb.Message.getFieldWithDefault(msg, 4, "")
maybeWaitTimeout: jspb.Message.getFieldWithDefault(msg, 4, ""),
locked: jspb.Message.getBooleanFieldWithDefault(msg, 5, false)
};

if (includeInstance) {
Expand Down Expand Up @@ -1111,6 +1112,10 @@ proto.api_container_api.Port.deserializeBinaryFromReader = function(msg, reader)
var value = /** @type {string} */ (reader.readString());
msg.setMaybeWaitTimeout(value);
break;
case 5:
var value = /** @type {boolean} */ (reader.readBool());
msg.setLocked(value);
break;
default:
reader.skipField();
break;
Expand Down Expand Up @@ -1168,6 +1173,13 @@ proto.api_container_api.Port.serializeBinaryToWriter = function(message, writer)
f
);
}
f = /** @type {boolean} */ (jspb.Message.getField(message, 5));
if (f != null) {
writer.writeBool(
5,
f
);
}
};


Expand Down Expand Up @@ -1252,6 +1264,42 @@ proto.api_container_api.Port.prototype.setMaybeWaitTimeout = function(value) {
};


/**
* optional bool locked = 5;
* @return {boolean}
*/
proto.api_container_api.Port.prototype.getLocked = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false));
};


/**
* @param {boolean} value
* @return {!proto.api_container_api.Port} returns this
*/
proto.api_container_api.Port.prototype.setLocked = function(value) {
return jspb.Message.setField(this, 5, value);
};


/**
* Clears the field making it undefined.
* @return {!proto.api_container_api.Port} returns this
*/
proto.api_container_api.Port.prototype.clearLocked = function() {
return jspb.Message.setField(this, 5, undefined);
};


/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.api_container_api.Port.prototype.hasLocked = function() {
return jspb.Message.getField(this, 5) != null;
};



/**
* List of repeated fields within this message type.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=js+dts"
// @generated by protoc-gen-connect-es v0.13.2 with parameter "target=js+dts"
// @generated from file api_container_service.proto (package api_container_api, syntax proto3)
h4ck3rk3y marked this conversation as resolved.
Show resolved Hide resolved
/* eslint-disable */
// @ts-nocheck
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=js+dts"
// @generated by protoc-gen-connect-es v0.13.2 with parameter "target=js+dts"
// @generated from file api_container_service.proto (package api_container_api, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v1.3.1 with parameter "target=js+dts"
// @generated by protoc-gen-es v1.5.1 with parameter "target=js+dts"
// @generated from file api_container_service.proto (package api_container_api, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down Expand Up @@ -122,6 +122,13 @@ export declare class Port extends Message<Port> {
*/
maybeWaitTimeout: string;

/**
* this is useful in the cloud context; ignore in local
*
* @generated from field: optional bool locked = 5;
*/
locked?: boolean;

constructor(data?: PartialMessage<Port>);

static readonly runtime: typeof proto3;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v1.3.1 with parameter "target=js+dts"
// @generated by protoc-gen-es v1.5.1 with parameter "target=js+dts"
// @generated from file api_container_service.proto (package api_container_api, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down Expand Up @@ -76,6 +76,7 @@ export const Port = proto3.makeMessageType(
{ no: 2, name: "transport_protocol", kind: "enum", T: proto3.getEnumType(Port_TransportProtocol) },
{ no: 3, name: "maybe_application_protocol", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 4, name: "maybe_wait_timeout", kind: "scalar", T: 9 /* ScalarType.STRING */ },
{ no: 5, name: "locked", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
],
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=js+dts"
// @generated by protoc-gen-connect-es v0.13.2 with parameter "target=js+dts"
// @generated from file engine_service.proto (package engine_api, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-connect-es v1.3.0 with parameter "target=js+dts"
// @generated by protoc-gen-connect-es v0.13.2 with parameter "target=js+dts"
// @generated from file engine_service.proto (package engine_api, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v1.3.1 with parameter "target=js+dts"
// @generated by protoc-gen-es v1.5.1 with parameter "target=js+dts"
// @generated from file engine_service.proto (package engine_api, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated by protoc-gen-es v1.3.1 with parameter "target=js+dts"
// @generated by protoc-gen-es v1.5.1 with parameter "target=js+dts"
// @generated from file engine_service.proto (package engine_api, syntax proto3)
/* eslint-disable */
// @ts-nocheck
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as grpcWeb from 'grpc-web';

import * as engine_service_pb from './engine_service_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
import * as engine_service_pb from './engine_service_pb'; // proto import: "engine_service.proto"
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; // proto import: "google/protobuf/empty.proto"


export class EngineServiceClient {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// Code generated by protoc-gen-grpc-web. DO NOT EDIT.
// versions:
// protoc-gen-grpc-web v1.4.2
// protoc-gen-grpc-web v1.5.0
// protoc v3.19.1
// source: engine_service.proto

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as jspb from 'google-protobuf'

import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb';
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
import * as google_protobuf_empty_pb from 'google-protobuf/google/protobuf/empty_pb'; // proto import: "google/protobuf/empty.proto"
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb'; // proto import: "google/protobuf/timestamp.proto"


export class GetEngineInfoResponse extends jspb.Message {
Expand Down
1 change: 1 addition & 0 deletions cli/cli/commands/service/add/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ func parsePortSpecStr(specStr string) (*kurtosis_core_rpc_api_bindings.Port, err
TransportProtocol: transportProtocolFromEnum,
MaybeApplicationProtocol: maybeApplicationProtocol,
MaybeWaitTimeout: defaultPortWaitTimeoutStr, //TODO we should add this to the port's arguments instead of using only a default value
Locked: nil,
}, nil
}

Expand Down
8 changes: 4 additions & 4 deletions cli/cli/commands/service/add/add_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ func TestParsePortSpecstr_SuccessCases(t *testing.T) {
args: args{
specStr: "http:3333",
},
want: &kurtosis_core_rpc_api_bindings.Port{Number: uint32(3333), TransportProtocol: kurtosis_core_rpc_api_bindings.Port_TCP, MaybeApplicationProtocol: "http", MaybeWaitTimeout: defaultPortWaitTimeoutStr},
want: &kurtosis_core_rpc_api_bindings.Port{Number: uint32(3333), TransportProtocol: kurtosis_core_rpc_api_bindings.Port_TCP, MaybeApplicationProtocol: "http", MaybeWaitTimeout: defaultPortWaitTimeoutStr, Locked: nil},
},
{
name: "Successfully parse str with application protocol and with transport protocol",
args: args{
specStr: "http:3333/udp",
},
want: &kurtosis_core_rpc_api_bindings.Port{Number: uint32(3333), TransportProtocol: kurtosis_core_rpc_api_bindings.Port_UDP, MaybeApplicationProtocol: "http", MaybeWaitTimeout: defaultPortWaitTimeoutStr},
want: &kurtosis_core_rpc_api_bindings.Port{Number: uint32(3333), TransportProtocol: kurtosis_core_rpc_api_bindings.Port_UDP, MaybeApplicationProtocol: "http", MaybeWaitTimeout: defaultPortWaitTimeoutStr, Locked: nil},
},
{
name: "Successfully parse str without application protocol and with transport protocol",
args: args{
specStr: "3333/udp",
},
want: &kurtosis_core_rpc_api_bindings.Port{Number: uint32(3333), TransportProtocol: kurtosis_core_rpc_api_bindings.Port_UDP, MaybeApplicationProtocol: "", MaybeWaitTimeout: defaultPortWaitTimeoutStr},
want: &kurtosis_core_rpc_api_bindings.Port{Number: uint32(3333), TransportProtocol: kurtosis_core_rpc_api_bindings.Port_UDP, MaybeApplicationProtocol: "", MaybeWaitTimeout: defaultPortWaitTimeoutStr, Locked: nil},
},
{
name: "Successfully parse str without application protocol and without transport protocol",
args: args{
specStr: "3333",
},
want: &kurtosis_core_rpc_api_bindings.Port{Number: uint32(3333), TransportProtocol: kurtosis_core_rpc_api_bindings.Port_TCP, MaybeApplicationProtocol: "", MaybeWaitTimeout: defaultPortWaitTimeoutStr},
want: &kurtosis_core_rpc_api_bindings.Port{Number: uint32(3333), TransportProtocol: kurtosis_core_rpc_api_bindings.Port_TCP, MaybeApplicationProtocol: "", MaybeWaitTimeout: defaultPortWaitTimeoutStr, Locked: nil},
},
}
for _, parsePortSpecTest := range parsePortSpecSuccessTests {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ func (service *ApiContainerGatewayServiceServer) startRunningConnectionForKurtos
TransportProtocol: privateApiPort.GetTransportProtocol(),
MaybeApplicationProtocol: privateApiPort.GetMaybeApplicationProtocol(),
MaybeWaitTimeout: privateApiPort.GetMaybeWaitTimeout(),
Locked: nil,
}
}

Expand Down
Loading
Loading