Skip to content

Commit 3008573

Browse files
authored
Remove Docker Support (#7896)
* remove docker cli integration as we will not be maintaining the docker configurations for test-proxy * remove all references to docker in readme
1 parent e7b6852 commit 3008573

10 files changed

Lines changed: 3 additions & 376 deletions

File tree

eng/common/testproxy/onboarding/common-asset-functions.ps1

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -207,41 +207,6 @@ Function Invoke-ProxyCommand {
207207
)
208208
$updatedDirectory = $TargetDirectory.Replace("`\", "/")
209209

210-
# CommandString just a string indicating the proxy arguments. In the default case of running against the proxy tool, can just be used directly.
211-
# However, in the case of docker, we need to append a bunch more arguments to the string.
212-
if ($TestProxyExe -eq "docker" -or $TestProxyExe -eq "podman"){
213-
$token = $env:GIT_TOKEN
214-
$committer = $env:GIT_COMMIT_OWNER
215-
$email = $env:GIT_COMMIT_EMAIL
216-
217-
if (-not $committer) {
218-
$committer = & git config --global user.name
219-
}
220-
221-
if (-not $email) {
222-
$email = & git config --global user.email
223-
}
224-
225-
if(-not $token -or -not $committer -or -not $email){
226-
Write-Error ("When running this transition script in `"docker`" or `"podman`" mode, " `
227-
+ "the environment variables GIT_TOKEN, GIT_COMMIT_OWNER, and GIT_COMMIT_EMAIL must be set to reflect the appropriate user. ")
228-
exit 1
229-
}
230-
231-
$targetImage = if ($env:TRANSITION_SCRIPT_DOCKER_TAG) { $env:TRANSITION_SCRIPT_DOCKER_TAG } else { "azsdkengsys.azurecr.io/engsys/test-proxy:latest" }
232-
233-
$CommandString = @(
234-
"run --rm --name transition.test.proxy",
235-
"-v `"${updatedDirectory}:/srv/testproxy`"",
236-
"-e `"GIT_TOKEN=${token}`"",
237-
"-e `"GIT_COMMIT_OWNER=${committer}`"",
238-
"-e `"GIT_COMMIT_EMAIL=${email}`"",
239-
$targetImage,
240-
"test-proxy",
241-
$CommandString
242-
) -join " "
243-
}
244-
245210
Write-Host "$TestProxyExe $CommandString"
246211
[array] $output = & "$TestProxyExe" $CommandString.Split(" ") --storage-location="$updatedDirectory"
247212
# echo the command output

eng/common/testproxy/onboarding/generate-assets-json.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ Generated assets.json file contents
2222
If flag InitialPush is set, recordings will be automatically pushed to the assets repo and the Tag property updated.
2323
2424
.PARAMETER TestProxyExe
25-
The executable used during the "InitialPush" action. Defaults to the dotnet tool test-proxy, but also supports "docker" or "podman".
25+
The executable used during the "InitialPush" action. Defaults to the dotnet tool test-proxy, but also supports custom executables as well.
2626
27-
If the user provides their own value that doesn't match options "test-proxy", "docker", or "podman", the script will use this input as the test-proxy exe
27+
If the user provides their own value that doesn't match options "test-proxy" the script will use this input as the test-proxy exe
2828
when invoking commands. EG "$TestProxyExe push -a sdk/keyvault/azure-keyvault-keys/assets.json."
2929
3030
.PARAMETER InitialPush

tools/test-proxy/Azure.Sdk.Tools.TestProxy/README.md

Lines changed: 1 addition & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ to documentation in your specific language repository in order to configure reco
1616

1717
- [Azure SDK Tools Test Proxy](#azure-sdk-tools-test-proxy)
1818
- [Test documentation by language:](#test-documentation-by-language)
19-
- [Table of contents](#table-of-contents)
2019
- [Installation](#installation)
2120
- [Via Local Compile or .NET](#via-local-compile-or-net)
22-
- [Via Docker Image](#via-docker-image)
23-
- [A note about docker caching](#a-note-about-docker-caching)
2421
- [Via Standalone Executable](#via-standalone-executable)
2522
- [Which should I install?](#which-should-i-install)
2623
- [Command line arguments](#command-line-arguments)
@@ -62,10 +59,6 @@ to documentation in your specific language repository in order to configure reco
6259
- [Providing your own `Host` header](#providing-your-own-host-header)
6360
- [Testing](#testing)
6461
- [SSL Support](#ssl-support)
65-
- [On Mac and Windows, .NET can be used to generate a local certificate](#on-mac-and-windows-net-can-be-used-to-generate-a-local-certificate)
66-
- [Option 1](#option-1)
67-
- [Option 2](#option-2)
68-
- [Docker Image + SSL](#docker-image--ssl)
6962
- [Troubleshooting](#troubleshooting)
7063
- [Visual studio](#visual-studio)
7164
- [ASP.NET and web development](#aspnet-and-web-development)
@@ -101,7 +94,7 @@ dotnet tool update azure.sdk.tools.testproxy --global --add-source https://pkgs.
10194

10295
The test-proxy is also available from the [azure-sdk-for-net public feed](https://dev.azure.com/azure-sdk/public/_artifacts/feed/azure-sdk-for-net)
10396

104-
_Note: if you're not authorized to access these feeds, make sure you have [Azure Artifacts Credential Provider](https://github.com/microsoft/artifacts-credprovider) installed. You can also [download executable](#via-standalone-executable) or use a prebuilt [docker image](#via-docker-image)._
97+
_Note: if you're not authorized to access these feeds, make sure you have [Azure Artifacts Credential Provider](https://github.com/microsoft/artifacts-credprovider) installed. You can also [download executable](#via-standalone-executable)._
10598

10699
To uninstall an existing test-proxy
107100

@@ -121,40 +114,6 @@ If you've already installed the tool, you can always check the installed version
121114
test-proxy --version
122115
```
123116

124-
### Via Docker Image
125-
126-
The Azure SDK Team maintains a public Azure Container Registry.
127-
128-
```powershell
129-
docker run -v <your-volume-name-or-location>:/srv/testproxy/ -p 5001:5001 -p 5000:5000 azsdkengsys.azurecr.io/engsys/test-proxy:latest
130-
```
131-
132-
For example, to save test recordings to disk in your repo's `/sdk/<service>/tests/recordings` directory, provide the path to the root of the repo:
133-
134-
```powershell
135-
docker run -v C:\\repo\\azure-sdk-for-<language>:/srv/testproxy/ -p 5001:5001 -p 5000:5000 azsdkengsys.azurecr.io/engsys/test-proxy:latest
136-
```
137-
138-
Note the **port and volume mapping** as arguments! Any files that exist in this volume locally will only be appended to/updated in place. It is a non-destructive initialize.
139-
140-
Within the container, recording outputs are written within the directory `/srv/testproxy/`.
141-
142-
NOTE: if you are authenticated to github via SSH keys instead of a credential manager with https, you must mount your ssh credentials into docker. The following command shows an example mounting the default ssh key ~/.ssh/id_rsa on linux:
143-
144-
```bash
145-
docker run -v /home/ben/.ssh:/root/.ssh -v /home/ben/sdk/azure-sdk-for-go:/srv/testproxy --add-host=host.docker.internal:host-gateway -p 5001:5001 -p 5000:5000 testproxy bash -c 'eval `ssh-agent` && ssh-add /root/.ssh/id_rsa && test-proxy start --dump'
146-
```
147-
148-
#### A note about docker caching
149-
150-
The azure-sdk team regularly update the image associated with the `latest` tag. Combined with the fact that docker will aggressively cache if possible, it is very possible that developers' local machines may be running outdated versions of the test-proxy.
151-
152-
To ensure that your local copy is up to date, run:
153-
154-
```powershell
155-
docker pull azsdkengsys.azurecr.io/engsys/test-proxy:latest
156-
```
157-
158117
### Via Standalone Executable
159118

160119
Standalone executable versions of the test-proxy are published to [github releases on this repository.](https://github.com/Azure/azure-sdk-tools/releases?q=Azure.Sdk.Tools.TestProxy&expanded=true)
@@ -286,7 +245,6 @@ The test-proxy is integrated with the following environment variables.
286245
| `Logging__LogLevel__Default` | Defaults to `Information`. Possible valid values are <br/><br/>`Debug`, `Information`, `Warning`, `Error`, `Critical`.<br><br>Do not set for .NET test runs as it would cause the tests *themselves* to start emitting logs.|
287246
| `Logging__LogLevel__Azure.Sdk.Tools.TestProxy`| Set to `Debug` to see request level logs emitted by the Test Proxy.|
288247

289-
Both of the above variables can be set in the `docker` runtime by providing additional arguments EG: `docker run -e Logging__LogLevel__Default=Warning azsdkengsys.azurecr.io/engsys/test-proxy:latest`. For multiple environment variables, just use multiple `-e` provisions.
290248

291249
## How do I use the test-proxy to get a recording?
292250

@@ -312,7 +270,6 @@ A couple notes before running the test-proxy:
312270

313271
- Reference [command line arguments](#command-line-arguments) and understand the options.
314272
- The test-proxy runs in a "context" which is just a directory on your disk. When initializing a recording, all paths should be relative to this context directory.
315-
- If running the proxy as a docker image, ensure you **map** `etc/testproxy/` to a target context directory on your drive. In the example `docker run` invocations above, look for the `-v` argument.
316273

317274
### Where will my recordings end up?
318275

@@ -789,36 +746,6 @@ Within this repository there is a single certificate.
789746

790747
- `eng/common/testproxy/dotnet-devcert.pfx`: generated on a `Ubuntu` distribution using `openssl`.
791748

792-
Unfortunately, the `dotnet dev-certs` generated certificates are _not_ acceptable to a standard ubuntu distro. The issue is that the `KeyUsage` field in the `.crt` [MUST contain](https://github.com/dotnet/aspnetcore/issues/7246#issuecomment-541165030) the `keyCertSign` flag. Certificates generated by `dotnet dev-certs` do NOT have this flag. This means that if you're on Windows AND running the Ubuntu docker image, you will need to trust the `dotnet-devcert.pfx` locally prior to `docker run`.
793-
794-
For further details on importing and using the provided dev-certificates, please investigate the [additional docker readme.](../docker/README.md)
795-
796-
### On Mac and Windows, .NET can be used to generate a local certificate
797-
798-
There are two options here, generate your own SSL Cert, or import an existing one.
799-
800-
#### Option 1
801-
802-
Invoke the command:
803-
804-
```powershell
805-
dotnet dev-certs https --trust
806-
```
807-
808-
This will be automatically retrieved if you run the nuget installed version of the tool. You may optionally use `openssl` [like so](https://raw.githubusercontent.com/BorisWilhelms/create-dotnet-devcert/f3b5da6f9107834eb31ea5ba7c0583e14cda6b31/create-dotnet-devcert.sh) to generate a certificate. Note that this shell script creates a dev cert that is compatible with ubuntu.
809-
810-
#### Option 2
811-
812-
Import the appropriate already existing certificate within the `eng/common/testproxy/` folder.
813-
814-
### Docker Image + SSL
815-
816-
To connect to the docker on SSL, both the docker image and your local machine must trust the same SSL cert. The docker image already has `dotnet-devcert.pfx` imported and trusted, so all that is necessary is to trust that same cert prior to `docker run`.
817-
818-
In the future, passing in a custom cert via a bound volume that contains your certificate will be a possibility as well.
819-
820-
For additional reading on this process for trusting SSL certs locally, feel free to read up [here.](https://devblogs.microsoft.com/aspnet/configuring-https-in-asp-net-core-across-different-platforms/) The afore-mentioned [docker specific readme](../docker/README.md) also has details that are relevant.
821-
822749
## Troubleshooting
823750

824751
### Visual studio

tools/test-proxy/ci.yml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,6 @@ extends:
2525
template: /eng/pipelines/templates/stages/archetype-sdk-tool-dotnet.yml
2626
parameters:
2727
ToolDirectory: tools/test-proxy
28-
DockerTagPrefix: '1.0.0-dev.'
29-
DockerDeployments:
30-
- name: test_proxy_linux
31-
pool: azsdk-pool-mms-ubuntu-2204-general
32-
vmImage: ubuntu-22.04
33-
dockerRepo: 'engsys/testproxy-lin'
34-
prepareScript: tools/test-proxy/docker/prepare.ps1
35-
dockerFile: 'tools/test-proxy/docker/dockerfile'
36-
stableTags:
37-
- 'latest'
38-
- name: test_proxy_linux_arm64
39-
pool: azsdk-pool-mms-ubuntu-2204-general
40-
vmImage: ubuntu-22.04
41-
dockerRepo: 'engsys/testproxy-lin-arm64'
42-
prepareScript: 'tools/test-proxy/docker/prepare.ps1 -qemu'
43-
additionalDockerArgs: '--build-arg ARCH=-arm64v8 --platform linux/arm64'
44-
dockerFile: 'tools/test-proxy/docker/dockerfile'
45-
stableTags:
46-
- 'latest'
47-
ManifestDeployment:
48-
- name: 'test_proxy_multiarch'
49-
dockerRepo: 'engsys/test-proxy'
50-
stableTags:
51-
- 'latest'
5228
ReleaseBinaries: true
5329
StandaloneExeMatrix:
5430
- rid: osx-x64

tools/test-proxy/docker/.dockerignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

tools/test-proxy/docker/README.md

Lines changed: 0 additions & 114 deletions
This file was deleted.

tools/test-proxy/docker/dockerfile

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)