Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.

Commit d6db7b4

Browse files
stishkinstas
andauthored
Refactoring (#194)
- Remove all azure dependencies from tooling and move it to dedicated container - Tools only need Http Get and Post to talk to Azure infrastructure - Move all authentication code into dedicated container - Move all Azure communication from test tools into a dedicated container - Remove all authentication code from test tools - Enable network driver selection: host and bridge Co-authored-by: stas <[email protected]>
1 parent 4b8a2bb commit d6db7b4

File tree

81 files changed

+1724
-1133
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+1724
-1133
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"container" : "{PrivateRegistryRestler}/restapifuzztesting/agent-utilities:v4.latest",
3+
"port" : 8085
4+
}

Scripts/CustomTools/tools/RESTler/config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
2-
"container" : "{PrivateRegistryRestler}/restapifuzztesting/restler-agent:v3.latest",
2+
"container" : "{PrivateRegistryRestler}/restapifuzztesting/restler-agent:v4.latest",
33
"shell" : "/bin/sh",
44
"run" : {
55
"shellArguments" : ["-c",
6-
"date; sleep ${RAFT_STARTUP_DELAY}; date; dotnet /raft/agent/RestlerAgent.dll --agent-name ${RAFT_CONTAINER_NAME} --job-id ${RAFT_JOB_ID} --task-config-path ${RAFT_WORK_DIRECTORY}/task-config.json --work-directory ${RAFT_WORK_DIRECTORY} --restler-path /RESTler --app-insights-instrumentation-key ${RAFT_APP_INSIGHTS_KEY} --output-sas \"${RAFT_SB_OUT_SAS}\""
6+
"sleep ${RAFT_STARTUP_DELAY}; dotnet /raft/agent/RestlerAgent.dll --agent-name ${RAFT_CONTAINER_NAME} --job-id ${RAFT_JOB_ID} --task-config-path ${RAFT_WORK_DIRECTORY}/task-config.json --work-directory ${RAFT_WORK_DIRECTORY} --restler-path /RESTler --agent-utilities-url ${RAFT_AGENT_UTILITIES_URL}"
7+
78
]
89
},
910
"idle" : {

ado/stages/build/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ stages:
1919
vmImage: 'ubuntu-latest'
2020
steps:
2121
- template: steps/restleragent.yml
22+
23+
- job: AgentUtilities
24+
pool:
25+
vmImage: 'ubuntu-latest'
26+
steps:
27+
- template: steps/agent-utilities.yml
2228

2329
- job: Orchestrator
2430
pool:
@@ -43,10 +49,4 @@ stages:
4349
vmImage: 'ubuntu-latest'
4450
steps:
4551
- template: steps/restler2postman.yml
46-
47-
- job: AzureAuthUtility
48-
pool:
49-
vmImage: 'ubuntu-latest'
50-
steps:
51-
- template: steps/azure-auth-utility.yml
5252

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
steps:
2+
- task: NuGetToolInstaller@1
3+
displayName: 'Use NuGet 5.8'
4+
inputs:
5+
versionSpec: 5.8
6+
7+
- task: NuGetCommand@2
8+
displayName: 'NuGet restore'
9+
inputs:
10+
restoreSolution: '**\AgentUtilities.sln'
11+
12+
- task: DotNetCoreCLI@2
13+
displayName: 'AgentUtilities'
14+
inputs:
15+
command: publish
16+
publishWebProjects: false
17+
projects: src/AgentUtilities/AgentUtilities/AgentUtilities.fsproj
18+
arguments: '-c release /p:version=$(versionNumber)'
19+
zipAfterPublish: false
20+
21+
# Because we are using a a release pipeline we need to publish the Dockerfile
22+
# in the artifacts, since the release pipeline does not have access to the code tree.
23+
- task: CopyFiles@2
24+
displayName: 'Copy AgentUtilities Dockerfile'
25+
inputs:
26+
targetFolder: src/AgentUtilities/AgentUtilities/bin/release/net5.0/publish/
27+
sourceFolder: src/AgentUtilities
28+
contents: Dockerfile
29+
30+
- task: PublishPipelineArtifact@1
31+
inputs:
32+
targetPath: src/AgentUtilities/AgentUtilities/bin/release/net5.0/publish/
33+
artifactName: AgentUtilities

ado/stages/build/steps/azure-auth-utility.yml

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

ado/stages/deploy/steps/upload-tools.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,6 @@ steps:
1111
- script: pip3 install -r cli/requirements.txt
1212
displayName: Install CLI Python requirements
1313

14-
- task: DownloadPipelineArtifact@2
15-
displayName: 'Download Local pipeline artifact'
16-
condition: and(succeeded(), eq('${{parameters.BuildArtifactsLocation}}', 'current'))
17-
inputs:
18-
artifact: AzureAuth
19-
path: $(Build.SourcesDirectory)/cli/raft-tools/auth/dotnet-5.0
20-
21-
- task: DownloadPipelineArtifact@2
22-
displayName: 'Download Production pipeline artifact'
23-
condition: and(always(), eq('${{parameters.BuildArtifactsLocation}}', 'production'))
24-
inputs:
25-
source: 'specific'
26-
project: 'raft'
27-
# The pipeline value is the pipeline definition id.
28-
# You can find it by looking at the url for the status badge.
29-
# In this case it's the pipeline named 'build-production'
30-
pipeline: 2925
31-
artifact: AzureAuth
32-
path: $(Build.SourcesDirectory)/cli/raft-tools/auth/dotnet-5.0
33-
runVersion: 'latest'
34-
3514
- task: AzureCLI@2
3615
continueOnError: false
3716
displayName: "Upload service utilities"

ado/stages/publish/publish.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ stages:
2929
parameters:
3030
BuildArtifactsLocation: ${{ parameters.BuildArtifactsLocation }}
3131

32+
- job: AgentUtilities
33+
pool:
34+
vmImage: 'ubuntu-latest'
35+
steps:
36+
- template: steps/agent-utilities.yml
37+
parameters:
38+
BuildArtifactsLocation: ${{ parameters.BuildArtifactsLocation }}
39+
3240
- job: TestInfra
3341
pool:
3442
vmImage: 'ubuntu-latest'
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
parameters:
2+
- name: BuildArtifactsLocation
3+
type: string
4+
5+
steps:
6+
- ${{ if or(eq(parameters.BuildArtifactsLocation, 'current'), eq(parameters.BuildArtifactsLocation, '')) }}:
7+
- task: DownloadPipelineArtifact@2
8+
displayName: 'Download Local pipeline artifact AgentUtilities'
9+
inputs:
10+
artifact: AgentUtilities
11+
path: $(Build.SourcesDirectory)/artifacts/AgentUtilities
12+
13+
- ${{ if eq(parameters.BuildArtifactsLocation, 'production') }}:
14+
- task: DownloadPipelineArtifact@2
15+
displayName: 'Download Production pipeline artifact AgentUtilities'
16+
inputs:
17+
source: 'specific'
18+
project: 'raft'
19+
pipeline: $(build-production-pipeline-id)
20+
artifact: AgentUtilities
21+
path: $(Build.SourcesDirectory)/artifacts/AgentUtilities
22+
runVersion: 'latest'
23+
24+
- task: Docker@2
25+
displayName: 'Publish Agent Utilities imageTag'
26+
inputs:
27+
command: buildAndPush
28+
buildContext: $(Build.SourcesDirectory)/artifacts/
29+
containerRegistry: $(raft-containerRegistryServiceConnection)
30+
repository: $(repositoryNamePrefix)/agent-utilities
31+
Dockerfile: $(Build.SourcesDirectory)/artifacts/AgentUtilities/Dockerfile
32+
tags: |
33+
$(imageTag)
34+
$(imageTagLatest)

ado/stages/publish/steps/cli.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ steps:
99
path: $(Build.SourcesDirectory)/artifacts/cli
1010
runVersion: 'latest'
1111

12-
# Azure auth library is kept in a seperate artifact. Merge into the
13-
# CLI tree here before the zip file is created.
14-
- task: DownloadPipelineArtifact@2
15-
displayName: 'Download Production Azure Auth pipeline artifact'
16-
inputs:
17-
source: 'specific'
18-
project: 'raft'
19-
pipeline: $(build-production-pipeline-id)
20-
artifact: AzureAuth
21-
path: $(Build.SourcesDirectory)/artifacts/cli/raft-tools/auth/dotnet-5.0
22-
runVersion: 'latest'
23-
2412
- task: ArchiveFiles@2
2513
displayName: Archive CLI
2614
inputs:

ado/stages/publish/steps/restleragent.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,7 @@ steps:
2828
inputs:
2929
source: 'specific'
3030
project: 'raft'
31-
# The pipeline value is the pipeline definition id.
32-
# You can find it by looking at the url for the status badge.
33-
# In this case it's the pipeline named 'build-production'
34-
pipeline: 2925
31+
pipeline: $(build-production-pipeline-id)
3532
artifact: RestlerAgent
3633
path: $(Build.SourcesDirectory)/artifacts/RestlerAgent
3734
runVersion: 'latest'

0 commit comments

Comments
 (0)