Skip to content

Commit 2e218cb

Browse files
committed
fix(nvidia-cuda): simplify keyring installation
1 parent fd277d0 commit 2e218cb

3 files changed

Lines changed: 4 additions & 20 deletions

File tree

features/src/nvidia-cuda/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A package which installs NVIDIA CUDA.
66

77
```json
88
"features": {
9-
"ghcr.io/postfinance/devcontainer-features/nvidia-cuda:0.1.0": {
9+
"ghcr.io/postfinance/devcontainer-features/nvidia-cuda:0.1.1": {
1010
"version": "latest",
1111
"installLibraries": true,
1212
"installDevLibraries": true,

features/src/nvidia-cuda/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "nvidia-cuda",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"name": "NVIDIA CUDA",
55
"description": "A package which installs NVIDIA CUDA.",
66
"options": {

features/src/nvidia-cuda/installer.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func runMain() error {
4747
// Create and process the feature
4848
feature := installer.NewFeature("NVIDIA CUDA", false,
4949
&cudaKeyringComponent{
50-
ComponentBase: installer.NewComponentBase("Keyring", installer.VERSION_LATEST),
50+
ComponentBase: installer.NewComponentBase("Keyring", installer.VERSION_IRRELEVANT),
5151
DownloadUrl: *downloadUrl,
5252
},
5353
)
@@ -122,29 +122,13 @@ func (c *cudaKeyringComponent) getCudaRepo() (string, error) {
122122
return "", fmt.Errorf("unsupported OS: %s", osInfo.Vendor)
123123
}
124124

125-
func (c *cudaKeyringComponent) GetAllVersions() ([]*gover.Version, error) {
126-
indexUrl, err := c.getCudaRepo()
127-
if err != nil {
128-
return nil, err
129-
}
130-
131-
allVersions, err := installer.Tools.Http.GetVersionsFromHtmlIndex(
132-
indexUrl,
133-
regexp.MustCompile(`^.*<a href=["']cuda-keyring_([0-9\.-]+)_.*\.deb["']>.*$`),
134-
regexp.MustCompile(`^(\d+)\.(\d+)-(\d+)$`))
135-
if err != nil {
136-
return nil, err
137-
}
138-
return allVersions, nil
139-
}
140-
141125
func (c *cudaKeyringComponent) InstallVersion(version *gover.Version) error {
142126
// Download the file
143127
cudaRepo, err := c.getCudaRepo()
144128
if err != nil {
145129
return err
146130
}
147-
downloadUrl := fmt.Sprintf("%s/cuda-keyring_%s_all.deb", cudaRepo, version.Raw)
131+
downloadUrl := fmt.Sprintf("%s/cuda-keyring_1.1-1_all.deb", cudaRepo)
148132
fileName := "cuda-keyring.deb"
149133
if err := installer.Tools.Download.ToFile(downloadUrl, fileName, "keyring"); err != nil {
150134
return err

0 commit comments

Comments
 (0)