-
Notifications
You must be signed in to change notification settings - Fork 45
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
EdgeCloud_LcM.yaml v0.9.2 with EdgeCloudZone and first Linter corrections. Documentation and User Story #208
Conversation
Adopted Edge Cloud Zone name. Adjusting errors detected in Linter for paths name for /app-instance and duplicated method which has been fixed including Delete method in /app-instance/{appId}. Method /app-instace/{appInstanceId} deleted.
One comment, The description says that EdgeCloudZone refers to an identifier but the attribute name EdgeCloudZone doesnt look like an identifier and the description itself refer to EdgeCloudZone to explain what EdgeCloudZone is. |
Hi @gunjald, Agree with your comment to make these changes |
One suggestion would be to update "Edge Cloud" to "Edge Cloud Zone" so we have a reference for EdgeCloudZone. |
Then we may rename EdgeCloudZone to EdgeCloudZoneId and replace the reference to EdgeCloudZone to EdgeCloudZoneId and the description will be fine as we will have the definition available in "Edge Cloud Zone" |
On line 122 we should replace "appId" with "appInstanceId" in "/app-instance/{appId}" as the appInstanceId is to be returned in POST /app-instance response |
One more point to discuss is if the appInstanceId should be globally unique identifier as described currently or should have a limited scope in context of a given application i.e. appId? But in that case other path may also need to be changed e.g. "/application/{appId}/app-instance", "/application/{appId}/instance/{appInstanceId}" etc |
Region and Edge Cloud Zone description updated. Parameters with UUID format have an Id at the end. Parameters with String format do not, that is why we decided to change RegionId to Region.
Hi @gunjald The descriptions have been modified according to the criteria:
Definitions at the beginning of the API have been updated. |
Regarding path changes: /application/{appId}/instance/{appInstanceId} It might make sense to change it and simplify the API, in the end an Instance belongs to the Application so only one path seems the right one to choose. But as it is a significant change, we could do it for the next version and for now try to clean up the API and have it ready for MWC. |
In that case i propose to change appId to appInstanceId in GET /app-instance/{appId} |
Ok, but maybe we would lose the functionality of getting a complete list of instances of an app, but that could be covered in future versions with a specific method. |
I dont think as we have already defined the /app-instance/{appId} path and just that appId need to change to appInstanceId. Isnt ti? |
But if you define the appInstanceId, then you are referring to a specific instance of the application instead, with the /app-instance/{appId} the intention is to retrieve all instances of an application (appId) and if the appInstanceId in the request body is set, then the information of the specific instance is retrieved. We notice that there is a better way to do it buy maybe for next version. Anyway that capability must be maintained. |
OK. Now i got it. In that case can we add a query parameter to retrieve a specific instance of the app? |
Yes, it is a good option |
Reorganization of the API structure to clean it up.
PR updated according to previous comments. |
First version of Gherkin test feature file for EdgeCloud_LCM including at lis one test with response ok and one test with response nok for all existing POST,GET,DELETE methods in version 0.9.2 (#208)
Changes seems fine to me |
type: string | ||
description: Human readable name of the geografical zone of the Edge Cloud Node. Defined by the OP. | ||
description: Human readable name of the geografical region of the Edge Cloud. Defined by the OP. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/geografical/geographical
My understanding of API Guidelines is that the schema definition ( |
Typically a collection pattern would expose both Is there a plan to add a path to add the individual resource? We would need unique identifiers, to avoid conflict with other edge cloud providers, e.g. So, GET / |
Changed. Thanks! |
Current GET \edgeCloudZones retrieve a list of zones where the application can be instantiated in POST /app/{appId}/instance. We don't see it useful for the moment to retrieve an specific Zone because is not going to be used but for best practices it will be fine to add it. In next releases we could use the GET /edgeCloudZones/urn:vf:abc123 for extended capabilities. |
Added "Provider" parameter to edgeCloudZone and adapted related methods. Spelling and camelCase corrections.
Thanks @javierlozallu - I think exposing a read operation for a single |
I fully agree with this idea. Sure, we can discuss it there. |
First version of the Edge Cloud LCM API documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the App APIs Javier!
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/AppInstantiation' | ||
required: true | ||
$ref: '#/components/schemas/AppManifest' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest App
instead of AppManifest
, to keep it simple and consistent with the API path /app
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this will be confusing because an App
schema may have more information like appId
. But in POST /app Developers are just sending the information of their app in an AppManifest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see an App component definition, though. So perhaps the AppManifest component should be renamed to App? Or is it expected that there is an App component definition which includes AppManifest as part of it? It would be confusing if the /app path creates an AppManifest instead of an App, if the plan is to include an App component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gainsley
The approach for POST /app
is that developers can send the information about their application to the Operator Platform. We used to name this information artifact
but we change it to AppManifest
to make it more understandable. So when developers send the application information, Operator Platform checks if all the parameters are suitable (download the image from the repository successfully), and if everything went well, OP store that information and creates appId
that is the identifier used to retrieve the information of the application (e.g. Developer are not sure about the version, they can use appId to get the information).
Perhaps, what you are saying makes sense in terms that an App
component needs to exist in order to retrieve all the information related to the application not only what the Developers
initially sends to the OP but also what OP has done with the information (creating the appId
). In that case, we can create an App
component that contains AppManifest
and AppID
, that will be used in the GET /app/{appId} response.
@@ -112,60 +108,38 @@ paths: | |||
example: | |||
status: 409 | |||
code: CONFLICT | |||
message: "Application already instantiated in the given Edge or Region" | |||
message: "App duplicated" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest App already exists
as the error message instead of App duplicated
, as the latter makes it sound like a duplicate was created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with you. Take it into account!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the criteria for a conflict here? Since this is a POST and the input is only the manifest, I'm not sure a conflict is something that can happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically the given 'name' of an object is also treated as a unique identifier within the scope of that organization's objects. So the conflict would be that an App with the given name already exists. This is necessary if the API path uses the name, i.e. DELETE /app/{name}
. But if we're only using server-generated IDs in the path, i.e. DELETE /app/{appId}
then it's not strictly necessary. But I would argue it's a user-friendly feature to ensure names assigned to objects are unique, otherwise it becomes difficult for users to distinguish the differences between objects with the same given name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add we should decide (and document) whether given names will be treated as unique identifiers or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect. We will add in the documentation which given names will be treated as unique identifiers.
I'm not sure if the criteria to declare that an application already exists
is only the name
, I mean that the criteria should be name
and version
because developers can have the same application name but different versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we use the pair name
+version
as the unique identifier. It would be easiest for us to continue with that approach, but we are open to discussion on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need more clarity on the scope of the identifier where it is unique e.g. globally or within an organization? In that case we also need to define what is an organization in our APIs so the uniqueness can be handled accordingly? In a global scope there can always be conflicts among "name+ version".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
responses: | ||
'202': | ||
description: Request accepted to be processed. It applies for async deletion process | ||
description: Request accepted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
202 provides the request was accepted, but there's no callback here to be notified of success/failure, or any way to retrieve the error was if the async process had a problem. Since we don't expect deleting an App definition to be a long-running process, I suggest just changing this to 200 and keeping the API simpler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
202 was adopted as @gunjald suggested. And we think is the best option as in CAMARA commonalities indicates that for async process 202 must be showed.
We know that there is no callback and for this MVP the way to know when a process is completed is using the GET method. In next releases callbacks should be added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I should have emphasized it more, but I would expect App APIs (which just manage definitions, i.e. database entries) to finish immediately. Do we expect App APIs to be long-running? In our case, the App APIs never modify instantiated objects (clusters/pods/running containers/etc). They just change the definition of the app, which is just a write to the database. In that case we should use 200, since 202 should only be used for long-running APIs.
In our case, we treat Apps like container images. You can update the container image (in the repository) but it doesn't affect any running containers. If you want to apply the change, you'll need to have the instance (re)pull the image from the repository and redeploy it. We keep a revision ID on the App definition (must like container images use tags/sha256 sums) to track the "version" of the App. The revision ID is incremented whenever the App definition is updated. We do not allow the App to be deleted if the are instances of the App running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App deletion with an app instance running is not allowed too.
I see your point but correct me if I'm wrong, the deletion process means that the image in the repository will be deleted and maybe this process could take some time (repository could be on a centralized node or shared with other MNOs/CSP) but If you think this is not the case and nobody else thinks otherwise I'm agree to change the response to 200
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javierlozallu Actually our LCM APIs and the Federation EWBI APIs have separate APIs for handling binary images, so deleting the App definition wouldn't actually trigger deleting the referenced image. This is primarily because multiple App definitions may want to share the same binary image(s), and especially for VM images, we want to avoid as much as possible having to re-upload large binary images if the user is re-creating an App definition for example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/app APIs in my opinion could be subjective on how a platform implements the handling. Some of the platform may just store in a central repository all the information from the API or some could even send it to the environments where they may expect it to launch later only on those environments. So if we provide a GET call to retrieve status of the /app API i think we can accommodate more wider platform implementations.
Changes to adapt the API with PR comments
Added EdgeCloudeZone schema to harmonize with SED. Updated version to 0.9.2, as relevant changes are made. Adaptation of the format to the MegalinterWorkflow criteria.
Are there open points that we still need to address for this PR? Reviewers, Please suggest if we need to conclude on to merge this PR. |
There is an open point, |
I would suggest we merge this and discuss unique identifier in a separate issue. |
Adopted Edge Cloud Zone name.
Adjusting errors detected in Linter for paths name for /app-instance and duplicated method which has been fixed including Delete method in /app-instance/{appId}. Method /app-instace/{appInstanceId} deleted.