-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for specifying timeout in catalogs
Since some chart may use more than the standard 5 min timeout that helm is configured with to install. Use string as type since there was some issues with using java.time.Duration and parsing with jackson.
- Loading branch information
Showing
9 changed files
with
111 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...src/test/java/fr/insee/onyxia/api/configuration/properties/CatalogsConfigurationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package fr.insee.onyxia.api.configuration.properties; | ||
|
||
import static fr.insee.onyxia.api.util.TestUtils.getClassPathResource; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import fr.insee.onyxia.api.configuration.CatalogWrapper; | ||
import fr.insee.onyxia.api.configuration.CustomObjectMapper; | ||
import java.util.List; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class CatalogsConfigurationTest { | ||
|
||
@Test | ||
void shouldBeAbleToParseCatalogWithTimeout() throws Exception { | ||
ObjectMapper objectMapper = new CustomObjectMapper().objectMapper(); | ||
String catalogWrapper = getClassPathResource("catalog-loader-test/catalog-wrapper.json5"); | ||
|
||
CatalogsConfiguration catalogsConfiguration = new CatalogsConfiguration(objectMapper); | ||
catalogsConfiguration.setCatalogs(catalogWrapper); | ||
catalogsConfiguration.load(); | ||
List<CatalogWrapper> resolvedCatalogs = catalogsConfiguration.getResolvedCatalogs(); | ||
|
||
assertEquals(1, resolvedCatalogs.size()); | ||
assertEquals("10m", resolvedCatalogs.getFirst().getTimeout()); | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
onyxia-api/src/test/resources/catalog-loader-test/catalog-wrapper.json5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// This file is a json5-file, which onyxia-api should be able to parse to a CatalogWrapper list | ||
[ | ||
{ | ||
"id": "ide", | ||
"name": "IDE", | ||
"description": "Services for datascientists.", | ||
"maintainer": "[email protected]", | ||
"location": "https://inseefrlab.github.io/helm-charts-interactive-services", | ||
"status": "PROD", | ||
"highlightedCharts": ["jupyter-python", "rstudio", "vscode-python"], | ||
// Single quote should be supported | ||
"timeout": '10m', | ||
"type": 'helm', | ||
/* block comment | ||
over several | ||
lines are supported */ | ||
"skipTlsVerify": false, | ||
"caFile": null, | ||
"allowSharing": false, | ||
"visible": { | ||
"user": true, | ||
// Trailing comma is supported | ||
"project": true, | ||
}, | ||
"restrictions": [ | ||
{ | ||
"userAttribute": { | ||
"key": "sub", | ||
"match": "^onyxia.*" | ||
} | ||
} | ||
] | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters