Skip to content

Commit

Permalink
Merge branch 'master' into jfrogGH-621-bulk-import
Browse files Browse the repository at this point in the history
  • Loading branch information
chb0github authored Oct 12, 2023
2 parents 5182422 + e0a11f8 commit 1574ee7
Show file tree
Hide file tree
Showing 16 changed files with 301 additions and 109 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 9.5.1 (Oct 12, 2023). Tested on Artifactory 7.68.14 with Terraform CLI v1.6.1

SECURITY:

* provider: Bump golang.org/x/net from 0.11.0 to 0.17.0 PR: [#824](https://github.com/jfrog/terraform-provider-artifactory/pull/824)

## 9.5.0 (Oct 11, 2023). Tested on Artifactory 7.68.14 with Terraform CLI v1.6.1

FEATURES:

* resource/artifactory_local_huggingfaceml_repository, resource/artifactory_remote_huggingfaceml_repository: add new local and remote resources for managing Hugging Face repository. PR: [#823](https://github.com/jfrog/terraform-provider-artifactory/pull/823)

## 9.4.0 (Oct 5, 2023). Tested on Artifactory 7.68.13 with Terraform CLI v1.6.0

FEATURES:
Expand Down
33 changes: 33 additions & 0 deletions docs/resources/local_huggingfaceml_repository.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
subcategory: "Local Repositories"
---
# Artifactory Local Hugging Face Repository Resource

Creates a local Hugging Face repository.

Official documentation can be found [here](https://jfrog.com/help/r/jfrog-artifactory-documentation/set-up-local-hugging-face-repositories).

## Example Usage

```hcl
resource "artifactory_local_huggingfaceml_repository" "local-huggingfaceml-repo" {
key = "local-huggingfaceml-repo"
}
```

## Argument Reference

Arguments have a one to one mapping with the [JFrog API](https://www.jfrog.com/confluence/display/RTF/Repository+Configuration+JSON).

The following arguments are supported, along with the [common list of arguments for the local repositories](local.md):

* `key` - (Required) the identity key of the repo.
* `description` - (Optional)
* `notes` - (Optional)

## Import

Local repositories can be imported using their name, e.g.
```
$ terraform import artifactory_local_huggingfaceml_repository.local-huggingfaceml-repo local-huggingfaceml-repo
```
4 changes: 2 additions & 2 deletions docs/resources/remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ repository-specific arguments, listed in separate repository-specific documents.
Passwords can only be used when encryption is turned off, according to [Key Encryption instruction](https://www.jfrog.com/confluence/display/RTF/Artifactory+Key+Encryption).
Since only the artifactory server can decrypt them it is impossible for terraform to diff changes correctly.

To get full management, passwords can be decrypted globally using `POST /api/system/decrypt`. If this is not possible,
the password diff can be disabled per resource with-- noting that this will require resources to be tainted for an update:
To get full management, passwords can be decrypted globally using `POST /api/system/decrypt`. If this is not possible, the password diff can be disabled per resource with `lifecycle.ignore_changes` -- noting that this will require resources to be tainted for an update:

```hcl
lifecycle {
Expand Down Expand Up @@ -82,3 +81,4 @@ All generic repo arguments are supported, in addition to:
the artifact directly from the cloud storage provider. Available in Enterprise+ and Edge licenses only.
* `cdn_redirect` - (Optional) When set, download requests to this repository will redirect the client to download
the artifact directly from AWS CloudFront. Available in Enterprise+ and Edge licenses only.
* `disable_url_normalization` - (Optional) Whether to disable URL normalization, default is `false`.
2 changes: 0 additions & 2 deletions docs/resources/remote_docker_repository.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ resource "artifactory_remote_docker_repository" "my-remote-docker" {
enable_token_authentication = true
url = "https://registry-1.docker.io/"
block_pushing_schema1 = true
disable_url_normalization = true
}
```

Expand All @@ -43,7 +42,6 @@ The following arguments are supported, along with the [common list of arguments
This value `[**]` must be assigned to the attribute manually, if user don't specify any other non-default values.
We don't want to make this attribute required, but it must be set to avoid the state drift on update. Note: Artifactory assigns
`[**]` on update if HCL doesn't have the attribute set or the list is empty.
* `disable_url_normalization` - (Optional) Whether to disable URL normalization, default is `false`.

## Import

Expand Down
34 changes: 34 additions & 0 deletions docs/resources/remote_huggingfaceml_repository.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
subcategory: "Remote Repositories"
---
# Artifactory Remote Hugging Face Repository Resource

Provides a remote Hugging Face repository.

Official documentation can be found [here](https://jfrog.com/help/r/jfrog-artifactory-documentation/set-up-remote-hugging-face-repositories).

## Example Usage

```hcl
resource "artifactory_remote_huggingfaceml_repository" "huggingfaceml-remote" {
key = "huggingfaceml-remote-foo25"
}
```

## Argument Reference

Arguments have a one to one mapping with the [JFrog API](https://www.jfrog.com/confluence/display/RTF/Repository+Configuration+JSON).

The following arguments are supported, along with the [common list of arguments for the remote repositories](remote.md):

* `key` - (Required) A mandatory identifier for the repository that must be unique. It cannot begin with a number or
contain spaces or special characters.
* `description` - (Optional)
* `notes` - (Optional)

## Import

Remote repositories can be imported using their name, e.g.
```
$ terraform import artifactory_remote_huggingfaceml_repository.huggingfaceml-remote huggingfaceml-remote
```
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ require (
github.com/sethvargo/go-password v0.2.0
github.com/stretchr/testify v1.7.2
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819
golang.org/x/net v0.11.0
golang.org/x/text v0.12.0
golang.org/x/net v0.17.0
golang.org/x/text v0.13.0
gopkg.in/ldap.v2 v2.5.1
gopkg.in/yaml.v3 v3.0.1
)
Expand Down Expand Up @@ -77,9 +77,9 @@ require (
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/zclconf/go-cty v1.13.3 // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/sys v0.13.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.1 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU=
Expand All @@ -202,8 +202,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
golang.org/x/net v0.11.0 h1:Gi2tvZIJyBtO9SDr1q9h5hEQCp/4L2RQ+ar0qjx2oNU=
golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ=
golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -217,15 +217,15 @@ golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc=
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
Expand Down
1 change: 1 addition & 0 deletions pkg/artifactory/provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func resourcesMap() map[string]*schema.Resource {
"artifactory_remote_generic_repository": remote.ResourceArtifactoryRemoteGenericRepository(),
"artifactory_remote_go_repository": remote.ResourceArtifactoryRemoteGoRepository(),
"artifactory_remote_helm_repository": remote.ResourceArtifactoryRemoteHelmRepository(),
"artifactory_remote_huggingfaceml_repository": remote.ResourceArtifactoryRemoteHuggingFaceRepository(),
"artifactory_remote_maven_repository": remote.ResourceArtifactoryRemoteMavenRepository(),
"artifactory_remote_nuget_repository": remote.ResourceArtifactoryRemoteNugetRepository(),
"artifactory_remote_pypi_repository": remote.ResourceArtifactoryRemotePypiRepository(),
Expand Down
16 changes: 13 additions & 3 deletions pkg/artifactory/resource/repository/default_repo_layout_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,19 @@ var defaultRepoLayoutMap = map[string]SupportedRepoClasses{
"helm": {
RepoLayoutRef: "simple-default",
SupportedRepoTypes: map[string]bool{
"local": true,
"remote": true,
"virtual": true, "federated": true,
"local": true,
"remote": true,
"virtual": true,
"federated": true,
},
},
"huggingfaceml": {
RepoLayoutRef: "simple-default",
SupportedRepoTypes: map[string]bool{
"local": true,
"remote": true,
"virtual": false,
"federated": false,
},
},
"ivy": {
Expand Down
13 changes: 1 addition & 12 deletions pkg/artifactory/resource/repository/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var PackageTypesLikeGeneric = []string{
"gitlfs",
"go",
"helm",
"huggingfaceml",
"npm",
"opkg",
"pub",
Expand Down Expand Up @@ -60,18 +61,6 @@ func (bp RepositoryBaseParams) Id() string {
var BaseLocalRepoSchema = utilsdk.MergeMaps(
repository.BaseRepoSchema,
map[string]*schema.Schema{
"includes_pattern": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "List of artifact patterns to include when evaluating artifact requests in the form of x/y/**/z/*. When used, only artifacts matching one of the include patterns are served. By default, all artifacts are included (**/*).",
},
"excludes_pattern": {
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "List of artifact patterns to exclude when evaluating artifact requests, in the form of x/y/**/z/*. By default no artifacts are excluded.",
},
"blacked_out": {
Type: schema.TypeBool,
Optional: true,
Expand Down
Loading

0 comments on commit 1574ee7

Please sign in to comment.