Merge pull request #1582 from balena-io/rgz/gpu-label

Fix gpu label support
This commit is contained in:
bulldozer-balena[bot] 2021-02-09 11:17:48 +00:00 committed by GitHub
commit cfc72e673b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -402,8 +402,11 @@ export async function addFeaturesFromLabels(
// bahavior of docker cli
// https://github.com/balena-os/balena-engine-cli/blob/19.03-balena/opts/gpus.go#L81-L89
service.config.deviceRequests.push({
Driver: '',
Count: 1,
DeviceIDs: [],
Capabilities: [['gpu']],
Options: {},
} as Dockerode.DeviceRequest),
};

View File

@ -503,8 +503,11 @@ describe('compose/service', () => {
describe('io.balena.features.gpu: Docker <-> Compose config', () => {
const gpuDeviceRequest = {
Driver: '',
DeviceIDs: [],
Count: 1,
Capabilities: [['gpu']],
Options: {},
};
it('should succeed from compose object', async () => {
const s = await Service.fromComposeObject(