Skip to content

Conversation

@sklyarevsky
Copy link

No description provided.

- `kernel_version` (optional): Kernel version (alternative to header)

**Response:**
- `202 Accepted`: Build job created or already in progress
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention error responses here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose later we should make an open API spec later.

"created_at": "2024-01-01T12:00:00Z",
"completed_at": "2024-01-01T12:05:00Z",
"duration": "5m0s",
"cache_path": "/var/cache/drbd-build-server/abc123....tar.gz",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like server internal info we should not leak. Maybe keep as debug header configured on server side?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we should refactor API later as written above

Initiates a build request for DRBD kernel modules.

**Request:**
- **Body**: Kernel headers as `tar.gz` archive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we give an example of header archive structure?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we don't use a specific archive structure. So, I don't think we should explain it. Perhaps it would be more convenient to provide more detailed examples at the MVC stage.


The server uses an intelligent caching mechanism:

- **Cache Key**: SHA256 hash of kernel version + kernel headers data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if user do not specify the version and specified exact version as in headers will it be different cache record and builds?

Also I guess we could specify that headers hash calculated on uncompressed headers

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be it would be more correct to not explain hashing algorithm

Initiates a build request for DRBD kernel modules.

**Request:**
- **Body**: Kernel headers as `tar.gz` archive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure we also need from the user the body Content-Type: application/gzip or maybe Content-Type: application/x-tar and Content-Encoding: gzip. I guess the first one is the correct way.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose later we should make an open API spec . We should get information how it will be useful and fix one. Now for prototype stage we can skip it.

Copy link
Contributor

@asergunov asergunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it should be at least two requests. One is POST to give headers to server and receive the hash based download link and job status link. Second request is GET of artefact blocking while it's building. Optionally user can ask for job status with separate parallel request but I'd make RESTless option when user should not invent its own timeouts but receive the status messages to the opened connection.


**Response:**
- `202 Accepted`: Build job created or already in progress
- `200 OK`: Cached module found, returns module file immediately
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have the same json response both return codes? May be give download link right away? What if we give download link even if it's not done yet? I mean we can give an option to keep connection opened while it's building. So user will not have to write loop and invent timeout values.

Copy link
Author

@sklyarevsky sklyarevsky Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should conduct a few tests, evaluate the build speed, and then make a decision based on the results. This is beyond the scope of the PR. Actually we need refactor API almost I suppose

}
```

### GET `/api/v1/download/{job_id}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be a hash instead of job id here. So proxies can cache it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now job id is the first 16 digets of hash

@asergunov
Copy link
Contributor

I actually can't see any reason to have job id. Because in our logic it's the same as build hash. I mean we should mention that job id is not a number, but string. This way we could change server behaviour without changing client

@asergunov
Copy link
Contributor

asergunov commented Nov 25, 2025

Let's just add todo sections to this document and some explanation: that's what we have now and that's what we going to change, why we want it. So we can merge this PR

@sklyarevsky sklyarevsky force-pushed the feature/drbd-build-server-readme branch 2 times, most recently from 0f90bb7 to 448f5fc Compare November 25, 2025 09:01
@duckhawk duckhawk force-pushed the feature/drbd-build-server-readme branch from 448f5fc to b530c9a Compare November 25, 2025 10:01
@sklyarevsky sklyarevsky force-pushed the feature/drbd-build-server-readme branch from b530c9a to 568b150 Compare November 25, 2025 11:27
@sklyarevsky sklyarevsky force-pushed the vkarpochev-drbd-build-server branch 6 times, most recently from 49fc3d5 to c6f2207 Compare November 25, 2025 15:55
@sklyarevsky
Copy link
Author

Need close because the API and design are outdated. Useful comments should be moved to PR328.

@asergunov
Copy link
Contributor

Need close because the API and design are outdated. Useful comments should be moved to PR328.

Please do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants