Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from Azure:main #441

Merged
merged 5 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ the main ServiceBusClientBuilder. -->

<!-- suppress eceptions caught to for tracing-->
<suppress checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck"
files="com.azure.containers.containerregistry.specialized.ContainerRegistryBlobClient.java"/>
files="com.azure.containers.containerregistry.ContainerRegistryContentClient.java"/>


<!-- Nested blocks are still readable in the switch statements in Avro. -->
Expand Down
16 changes: 8 additions & 8 deletions eng/jacoco-test-coverage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,17 +318,17 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-common</artifactId>
<version>12.21.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-common;current} -->
<version>12.21.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-common;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.22.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-blob;current} -->
<version>12.22.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-blob;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob-batch</artifactId>
<version>12.18.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-blob-batch;current} -->
<version>12.18.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-blob-batch;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand All @@ -338,7 +338,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob-cryptography</artifactId>
<version>12.21.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-blob-cryptography;current} -->
<version>12.21.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-blob-cryptography;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand All @@ -348,22 +348,22 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-file-share</artifactId>
<version>12.18.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-file-share;current} -->
<version>12.18.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-file-share;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-file-datalake</artifactId>
<version>12.15.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-file-datalake;current} -->
<version>12.15.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-file-datalake;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-internal-avro</artifactId>
<version>12.7.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-internal-avro;current} -->
<version>12.7.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-internal-avro;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-queue</artifactId>
<version>12.17.0-beta.1</version> <!-- {x-version-update;com.azure:azure-storage-queue;current} -->
<version>12.17.0-beta.2</version> <!-- {x-version-update;com.azure:azure-storage-queue;current} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
Expand Down
2 changes: 2 additions & 0 deletions eng/mgmt/automation/api-specs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ mysql:
service: mysqlflexibleserver
network:
suffix: generated
newrelic:
service: newrelicobservability
operationalinsights:
service: loganalytics
postgresql:
Expand Down
17 changes: 9 additions & 8 deletions eng/versioning/version_client.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,17 @@ com.azure:azure-sdk-template-two;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-sdk-template-three;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-spring-data-cosmos;3.33.0;3.34.0-beta.1
com.azure:azure-spring-data-cosmos-test;3.0.0-beta.1;3.0.0-beta.1
com.azure:azure-storage-blob;12.21.1;12.22.0-beta.1
com.azure:azure-storage-blob-batch;12.17.1;12.18.0-beta.1
com.azure:azure-storage-blob;12.21.1;12.22.0-beta.2
com.azure:azure-storage-blob-batch;12.17.1;12.18.0-beta.2
com.azure:azure-storage-blob-changefeed;12.0.0-beta.18;12.0.0-beta.19
com.azure:azure-storage-blob-cryptography;12.20.1;12.21.0-beta.1
com.azure:azure-storage-blob-cryptography;12.20.1;12.21.0-beta.2
com.azure:azure-storage-blob-nio;12.0.0-beta.19;12.0.0-beta.20
com.azure:azure-storage-common;12.20.1;12.21.0-beta.1
com.azure:azure-storage-file-share;12.17.1;12.18.0-beta.1
com.azure:azure-storage-file-datalake;12.14.1;12.15.0-beta.1
com.azure:azure-storage-internal-avro;12.6.1;12.7.0-beta.1
com.azure:azure-storage-common;12.20.1;12.21.0-beta.2
com.azure:azure-storage-file-share;12.17.1;12.18.0-beta.2
com.azure:azure-storage-file-datalake;12.14.1;12.15.0-beta.2
com.azure:azure-storage-internal-avro;12.6.1;12.7.0-beta.2
com.azure:azure-storage-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-storage-queue;12.16.1;12.17.0-beta.1
com.azure:azure-storage-queue;12.16.1;12.17.0-beta.2
com.azure:azure-template-perf;1.0.0-beta.1;1.0.0-beta.1
com.azure:azure-media-videoanalyzer-edge;1.0.0-beta.6;1.0.0-beta.7
com.azure:azure-verticals-agrifood-farming;1.0.0-beta.3;1.0.0-beta.4
Expand Down Expand Up @@ -401,6 +401,7 @@ com.azure.resourcemanager:azure-resourcemanager-storagemover;1.0.0;1.1.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.0.0-beta.1;1.0.0-beta.1
com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-graphservices;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-newrelicobservability;1.0.0-beta.1;1.0.0-beta.2
com.azure.tools:azure-sdk-archetype;1.0.0;1.2.0-beta.1
com.azure.tools:azure-sdk-build-tool;1.0.0-beta.1;1.0.0-beta.2

Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
<module>sdk/mysqlflexibleserver</module>
<module>sdk/netapp</module>
<module>sdk/networkfunction</module>
<module>sdk/newrelicobservability</module>
<module>sdk/nginx</module>
<module>sdk/notificationhubs</module>
<module>sdk/oep</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import com.azure.containers.containerregistry.perf.core.ServiceTest;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.perf.test.core.NullOutputStream;
import com.azure.perf.test.core.PerfStressOptions;
import reactor.core.publisher.Mono;
Expand Down Expand Up @@ -36,13 +37,13 @@ public Mono<Void> setupAsync() {

@Override
public void run() {
blobClient.downloadStream(digest[0], Channels.newChannel(output), Context.NONE);
blobClient.downloadStream(digest[0], Channels.newChannel(output));
}

@Override
public Mono<Void> runAsync() {
return blobAsyncClient.downloadStream(digest[0])
.flatMap(result -> result.writeValueTo(Channels.newChannel(output)))
.flatMap(result -> FluxUtil.writeToOutputStream(result.toFluxByteBuffer(), output))
.then();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import com.azure.containers.containerregistry.ContainerRegistryAsyncClient;
import com.azure.containers.containerregistry.ContainerRegistryClient;
import com.azure.containers.containerregistry.ContainerRegistryClientBuilder;
import com.azure.containers.containerregistry.specialized.ContainerRegistryBlobAsyncClient;
import com.azure.containers.containerregistry.specialized.ContainerRegistryBlobClient;
import com.azure.containers.containerregistry.specialized.ContainerRegistryBlobClientBuilder;
import com.azure.containers.containerregistry.ContainerRegistryContentAsyncClient;
import com.azure.containers.containerregistry.ContainerRegistryContentClient;
import com.azure.containers.containerregistry.ContainerRegistryContentClientBuilder;
import com.azure.core.credential.TokenCredential;
import com.azure.core.http.netty.NettyAsyncHttpClientProvider;
import com.azure.core.http.okhttp.OkHttpAsyncClientProvider;
Expand Down Expand Up @@ -60,8 +60,8 @@ public abstract class ServiceTest<TOptions extends PerfStressOptions> extends Pe
*/
protected ContainerRegistryAsyncClient containerRegistryAsyncClient;

protected ContainerRegistryBlobClient blobClient;
protected ContainerRegistryBlobAsyncClient blobAsyncClient;
protected ContainerRegistryContentClient blobClient;
protected ContainerRegistryContentAsyncClient blobAsyncClient;

/**
* The base class for Azure Container Registry performance tests.
Expand Down Expand Up @@ -91,11 +91,11 @@ public ServiceTest(TOptions options) {
this.containerRegistryClient = builder.buildClient();
this.containerRegistryAsyncClient = builder.buildAsyncClient();

ContainerRegistryBlobClientBuilder blobClientBuilder = new ContainerRegistryBlobClientBuilder()
ContainerRegistryContentClientBuilder blobClientBuilder = new ContainerRegistryContentClientBuilder()
.credential(tokenCredential)
.clientOptions(httpOptions)
.endpoint(registryEndpoint)
.repository("oci-artifact");
.repositoryName("oci-artifact");

this.blobClient = blobClientBuilder.buildClient();
this.blobAsyncClient = blobClientBuilder.buildAsyncClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@

### Features Added

### Breaking Changes

- Replaced `uploadManifest(OciImageManifest)` method on `ContainerRegistryBlobClient` and `ContainerRegistryBlobAsyncClient` classes
with `uploadManifest(OciImageManifest manifest, String tag)` method.
### Breaking Changes from version 1.1.0-beta.3

- `ContainerRegistryBlobClientBuilder`, `ContainerRegistryBlobClient` and `ContainerRegistryBlobAsyncClient` were renamed to `ContainerRegistryContentClientBuilder`,
`ContainerRegistryContentClient`, and `ContainerRegistryContentAsyncClient` and moved to `com.azure.containers.containerregistry` package.
- `UploadBlobResult` was renamed to `UploadRegistryBlobResult`
- `ContainerRegistryContentClient` and `ContainerRegistryContentAsyncClient` changes:
- `uploadManifest` method was renamed to `setManifest`, `uploadManifestWithResponse` renamed to `setManifestWithResponse`, the return type of these methods was renamed to `SetManifestResult`.
`UploadManifestOptions` renamed to `SetManifestOptions`.
- `downloadManifest` method was renamed to `getManifest`, `downloadManifestWithResponse` renamed to `getManifestWithResponse`, the return type of these methods renamed to `GetManifestResult`.
- Removed `DownloadBlobAsyncResult` and changes `ContainerRegistryContentAsyncClient.downloadStream` return type to `Mono<BinaryData>`.
- Removed `Collection<ManifestMediaType> mediaTypes` parameter from `downloadManifestWithResponse` method on blob clients.
- Renamed `ContainerRegistryContentClientBuilder.repository` method to `repositoryName`.
- Renamed `GetManifestResult.getMediaType` and `UploadManifestOptions.getMediaType` to `getManifestMediaType`.
- Removed `GetManifestResult.asOciManifest` - use `GetManifestResult.getManifest().toObject(OciImageManifest.class)` instead.
- Renamed `OciImageManifest.getConfig` and `setConfig` methods to `getConfiguration` and `setConfiguration`.
- Renamed `OciAnnotations.getCreated` and `setCreated` methods to `getCreatedOn` and `setCreatedOn`.

### Bugs Fixed

Expand Down Expand Up @@ -183,8 +195,8 @@
## 1.0.0 (2022-01-11)

### Breaking Changes
- Renamed `ArtifactTagOrderBy` to `ArtifactTagOrder`.
- Renamed `ArtifactManifestOrderBy` to `ArtifactManifestOrder`.
- Renamed `ArtifactTagOrderBy` to `ArtifactTagOrder`.
- Renamed `ArtifactManifestOrderBy` to `ArtifactManifestOrder`.

### Other Changes

Expand Down
36 changes: 18 additions & 18 deletions sdk/containerregistry/azure-containers-containerregistry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,16 +251,16 @@ try {

### Blob and manifest operations

This section contains samples for `ContainerRegistryBlobClient` that show how to upload and download images.
This section contains samples for `ContainerRegistryContentClient` that show how to upload and download images.

First, we need to create blob client.

```java readme-sample-createBlobClient
```java readme-sample-createContentClient
DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build();
ContainerRegistryBlobClient blobClient = new ContainerRegistryBlobClientBuilder()
ContainerRegistryContentClient contentClient = new ContainerRegistryContentClientBuilder()
.endpoint(endpoint)
.credential(credential)
.repository(repository)
.repositoryName(repository)
.buildClient();
```

Expand All @@ -272,7 +272,7 @@ which describes an image or artifact and assign it a tag.
```java readme-sample-uploadImage
BinaryData configContent = BinaryData.fromObject(Collections.singletonMap("hello", "world"));

UploadBlobResult configUploadResult = blobClient.uploadBlob(configContent);
UploadRegistryBlobResult configUploadResult = contentClient.uploadBlob(configContent);
System.out.printf("Uploaded config: digest - %s, size - %s\n", configUploadResult.getDigest(), configContent.getLength());

OciDescriptor configDescriptor = new OciDescriptor()
Expand All @@ -281,19 +281,19 @@ OciDescriptor configDescriptor = new OciDescriptor()
.setSizeInBytes(configContent.getLength());

BinaryData layerContent = BinaryData.fromString("Hello Azure Container Registry");
UploadBlobResult layerUploadResult = blobClient.uploadBlob(layerContent);
UploadRegistryBlobResult layerUploadResult = contentClient.uploadBlob(layerContent);
System.out.printf("Uploaded layer: digest - %s, size - %s\n", layerUploadResult.getDigest(), layerContent.getLength());

OciImageManifest manifest = new OciImageManifest()
.setConfig(configDescriptor)
.setConfiguration(configDescriptor)
.setSchemaVersion(2)
.setLayers(Collections.singletonList(
new OciDescriptor()
.setDigest(layerUploadResult.getDigest())
.setSizeInBytes(layerContent.getLength())
.setMediaType("application/octet-stream")));

UploadManifestResult manifestResult = blobClient.uploadManifest(manifest, "latest");
SetManifestResult manifestResult = contentClient.setManifest(manifest, "latest");
System.out.printf("Uploaded manifest: digest - %s\n", manifestResult.getDigest());
```

Expand All @@ -302,37 +302,37 @@ System.out.printf("Uploaded manifest: digest - %s\n", manifestResult.getDigest()
To download a full image, we need to download its manifest and then download individual layers and configuration.

```java readme-sample-downloadImage
DownloadManifestResult manifestResult = blobClient.downloadManifest("latest");
GetManifestResult manifestResult = contentClient.getManifest("latest");

OciImageManifest manifest = manifestResult.asOciManifest();
OciImageManifest manifest = manifestResult.getManifest().toObject(OciImageManifest.class);
System.out.printf("Got manifest:\n%s\n", PRETTY_PRINT.writeValueAsString(manifest));

String configFileName = manifest.getConfig().getDigest() + ".json";
blobClient.downloadStream(manifest.getConfig().getDigest(), createFileChannel(configFileName));
String configFileName = manifest.getConfiguration().getDigest() + ".json";
contentClient.downloadStream(manifest.getConfiguration().getDigest(), createFileChannel(configFileName));
System.out.printf("Got config: %s\n", configFileName);

for (OciDescriptor layer : manifest.getLayers()) {
blobClient.downloadStream(layer.getDigest(), createFileChannel(layer.getDigest()));
contentClient.downloadStream(layer.getDigest(), createFileChannel(layer.getDigest()));
System.out.printf("Got layer: %s\n", layer.getDigest());
}
```

#### Delete blob

```java readme-sample-deleteBlob
DownloadManifestResult manifestResult = blobClient.downloadManifest("latest");
GetManifestResult manifestResult = contentClient.getManifest("latest");

OciImageManifest manifest = manifestResult.asOciManifest();
OciImageManifest manifest = manifestResult.getManifest().toObject(OciImageManifest.class);
for (OciDescriptor layer : manifest.getLayers()) {
blobClient.deleteBlob(layer.getDigest());
contentClient.deleteBlob(layer.getDigest());
}
```

#### Delete manifest

```java readme-sample-deleteManifest
DownloadManifestResult manifestResult = blobClient.downloadManifest("latest");
blobClient.deleteManifest(manifestResult.getDigest());
GetManifestResult manifestResult = contentClient.getManifest("latest");
contentClient.deleteManifest(manifestResult.getDigest());
```

## Troubleshooting
Expand Down
Loading