-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add Testing of Conda Artifacts #18478
Merged
Merged
Changes from 82 commits
Commits
Show all changes
130 commits
Select commit
Hold shift + click to select a range
4b16b17
extending documentation, initial tox_conda integration
scbedd f646f31
update to ensure that various build packages do not stomp on each other
scbedd 8c541aa
Merge remote-tracking branch 'upstream/master' into feature/add-conda…
scbedd 4c16140
add build and test
scbedd ab4bdc9
removing beforeteststeps
scbedd 2955932
remove updates to archetype-conda-release
scbedd e64a44e
remove double argument
scbedd bbe623a
remove extraneous stuff
scbedd 7be9322
disable doc gen and real test frameworks to speed up the core loop
scbedd f00e054
undo changes to core/ci.yml so as to not trigger the world
scbedd 0c658f1
can't use conda index without conda build
scbedd 00a229f
clean up
scbedd 088df50
change locations
scbedd b6e75cd
remove erroneous targeting
scbedd 9effa73
properly activate the environment so we have write access to it
scbedd 028b757
build
scbedd c254901
get bad conda naming out of install
scbedd f33f1f6
install the actual artifact
scbedd 0acc7d0
move meta.yml into its own folder. change working directory for creat…
scbedd 8b18376
Merge branch 'feature/add-conda-testing' of https://github.com/scbedd…
scbedd 1a83adc
it's hanging waiting for user intervention. need to apply argument --…
scbedd b21ab26
get the working directory correct. almost ready to pytest!
scbedd 798cefb
need to run tests _as they were_
scbedd d07e7a6
find paths
scbedd 976c1ad
correct the path being pass
scbedd b2cbe75
install tools from correct directory
scbedd 4aabe9e
update storage to store meta.yml in its own folder
scbedd ba0e9dc
first attempt at crossplat solution
scbedd 99cba74
Revert "first attempt at crossplat solution"
scbedd 6fa0220
handle cross-plat
scbedd ec36125
we need to add a different scripts directory on windows vs ubuntu/mac
scbedd f5f73b1
update pip install for windows such that it will run user specific if…
scbedd 37487c2
remove unnecessary script. some cleanup. time to get these python env…
scbedd 96315ad
ensure that we create conda with the correct python version
scbedd dc6af3a
apparently moving to pwsh from powershell changes things. somehow
scbedd 20810fc
outputting which version is running
scbedd 71ea1b6
debugging for windows
scbedd d4103f2
add dumping of environment information
scbedd f21baf8
removing extra activate
scbedd 33e1487
dump additional variables. does windows need to only be activated once?
scbedd fc663d3
bad formatting pwsh
scbedd 12f626a
if we change the order does this thing work?
scbedd 1345a77
fixing error
scbedd 52f4d26
OsVmImage is a variable
scbedd ce17d1b
adjusting conditional back to parameter. adding to dump script
scbedd 6044540
ensure we are running the python from the environment
scbedd 76b0062
switch from contains to eq
scbedd 0df4a73
daniel gave assist with wonky parameter expansion
scbedd bfc2fb6
easier attempt at prepend
scbedd 79363e5
correct pshell call
scbedd b4a27af
prepend path with bin and scripts. scripts last.
scbedd f9e9b1f
try create instead of env create
scbedd 98c4c00
change ordering
scbedd 8673dc4
I think I got it!
scbedd 71e6b86
clean up.
scbedd 7fa1e11
update the platform matrixs to go after pypy3
scbedd a0bc94d
output the command we're actually running
scbedd 9ee7daf
restore pypy3.6 to pypy3. hosted tool cache is named that way
scbedd 07e7677
override the python version to use pypy3.7 if necessary
scbedd 71ec768
go after conda forge. last remaining item is to get the order of ops …
scbedd f2c330a
need to figure out why the bin prepend isn't working
scbedd 6f63ae5
this is getting hilariously more complex
scbedd 9700a76
change how we call this thing
scbedd 9ed0262
update the calls to directl use the path instead of the environment name
scbedd 7bae2d1
attempting referencing the correct bin
scbedd ec233f2
the activate hack works
scbedd a596bf7
output the path. on linux, use conda/bin/activate, on windows, use ju…
scbedd b7f1db2
the path prepend isn't working is it
scbedd 88a644f
clean up pass. time to get pypy3 working
scbedd adea764
more clean up
scbedd 322113b
try creating the environment slightly differently by changing how we …
scbedd ee04097
update the target from pypy3 to pypy3.7
scbedd 67defee
index _first_ using conda build in the base environment. then install…
scbedd e1326cc
prep for having to call executable pypy3. create a build env that is …
scbedd 1d3a254
swap over to invoking the correct python
scbedd e633f10
ensure we also install pip on pypy3
scbedd 877e1db
checking to see if pypy3 properly aliases python
scbedd 7821f37
remove extraneous comments now that we know that python is aliased pr…
scbedd 3013d50
restore buildDocs default. originally changed to speed up iterations
scbedd 1a7f0c6
install an established set of dev requirements
scbedd e4a2672
install mock, trio
scbedd 1c1e481
adding installation of azure-identity by default.
scbedd 1231342
add explicit utures requirement as it's being incidentally installed…
scbedd f4d6554
ensure that we also pass in the channel such that the artifact depend…
scbedd a28b1a8
name the azure conda channel appropriately
scbedd 25f690d
resolve the issue with python_version requres for futures
scbedd 8f8f735
add cryptography dependency set
scbedd 5f5bcaa
ensure the echo matches
scbedd 8e17e52
add debugging step to dump environment variables, pip environment, an…
scbedd 997f94c
disable regular testing
scbedd 00af21c
bring in sdk/conftest.py
scbedd 25e8859
additional debugging. swapping the clone to grab everything in the repo
scbedd 97fac59
dumping what we cloned down before we attempt to access it
scbedd c7955cf
instead grab everything in sdk
scbedd 1c9a590
disable doc building, add tools back into what gets cloned down
scbedd c1fffcf
eliminate extra debugging output. narrow the scope down to sdk/servic…
scbedd b791c91
add adal to conda test environment
scbedd a75f9c6
updating docs to reflect support
scbedd 3440d5a
abstract at job level
scbedd 64e3a1c
fix indendtation of additional job
scbedd e8be183
make entire step optional
scbedd 370fc65
use default
scbedd 915a1f0
job steps are still skipping
scbedd 972c5eb
remove one of the conditions so we can see what is evaluating
scbedd 3ba32fc
there are conda tests to be run
scbedd 0528051
Merge branch 'master' into feature/add-conda-testing
scbedd c1cd932
splitting this entire thing into a conditional
scbedd ac08e2d
instead of hacking some expression evaluation at run time, split up t…
scbedd 4d854f6
update the alignment
scbedd a62bdb1
remove references or add missing argument
scbedd 5500af1
assent to forced cloudconfig
scbedd 5ff0b5c
ability to run multiple matrices in place
scbedd e9aa584
close gt()
scbedd c10e262
undo all the testing changes.
scbedd 36fd90f
merge master so as to undo changes to the eng/common
scbedd 35ad3c9
swap to newer version of azure core
scbedd 0e2a8f6
even newer version of azure-core
scbedd ca88f4f
revert back ot 1.12.0
scbedd bd9d6fb
re-order installation. add pip freeze
scbedd 3cee356
ensure that the correct version of azure_core is installed
scbedd 6a9b5df
force-reinstall isn't doing anything
scbedd 107f7f0
activate env and install dependencies first, then install azure-ident…
scbedd a599c0a
split environment prep and package installation into separate steps
scbedd 0179567
change ordering
scbedd 30ba4a6
re-ordering is working. now we just gotta prevent reinstall of azure-…
scbedd 237e172
last cleanup, finally going to merge this!
scbedd 72d6510
remove the --force-reinstall that I believe is making this thing not …
scbedd 1b39599
we do not need to reinstall all the dependencies each time. we just n…
scbedd 114a69e
bad reference to checkout
scbedd 12511fe
update the conda_test_requirements to be installable from root of repo
scbedd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
variables: | ||
AZURESDK_CONDA_VERSION: '2021.05.01' | ||
AZURESDK_CONDA_VERSION: '2021.05.01b1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
aiohttp>=3.0; python_version >= '3.5' | ||
../../../tools/azure-devtools | ||
../../../tools/azure-sdk-tools | ||
mock; | ||
aiodns>=2.0; python_version >= '3.5' | ||
parameterized>=0.7.3; python_version >= '3.0' | ||
trio; python_version >= '3.5' | ||
typing_extensions>=3.7.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
parameters: | ||
- name: TestPipeline | ||
type: boolean | ||
default: false | ||
- name: ServiceDirectory | ||
type: string | ||
default: '' | ||
- name: CondaArtifacts | ||
type: object | ||
default: [] | ||
- name: TestMarkArgument | ||
type: string | ||
default: '' | ||
- name: PythonVersion | ||
type: string | ||
default: '' | ||
- name: OSVmImage | ||
type: string | ||
default: '' | ||
|
||
steps: | ||
- task: DownloadPipelineArtifact@2 | ||
inputs: | ||
artifactName: 'conda' | ||
targetPath: $(Build.ArtifactStagingDirectory) | ||
|
||
- template: /eng/common/pipelines/templates/steps/set-test-pipeline-version.yml | ||
parameters: | ||
PackageName: "azure-template" | ||
ServiceDirectory: "template" | ||
TestPipeline: ${{ parameters.TestPipeline }} | ||
|
||
- task: UsePythonVersion@0 | ||
displayName: 'Use Python $(PythonVersion)' | ||
inputs: | ||
versionSpec: $(PythonVersion) | ||
|
||
- pwsh: | | ||
# due to faulty deployed scripts/how the path gets manipulated by conda actions on | ||
# ubuntu and mac, we can't rely on bin/scripts being referenced correctly. see | ||
# https://github.com/MicrosoftDocs/azure-devops-docs/issues/3812 | ||
$activateMethod = "source $($env:CONDA)/bin/activate" | ||
|
||
# pypy3 is not a true python executable. in conda-land, we need to call it using pypy3, NOT python | ||
|
||
# on windows, we need to add "--user" as otherwise pip won't successfully install/uninstall due to | ||
# how windows holds reservation on pip.exe. this is unnecessary on ubuntu/mac. | ||
$requirementSuffix = "" | ||
|
||
# we always want to prepend the path with conda bin | ||
Write-Host "##vso[task.prependpath]]$($env:CONDA)/bin" | ||
|
||
if ($IsWindows) { | ||
# powershell does not have an equivalent of call/source, which is necessary when | ||
# using conda in azure devops. Note that we use `activate` natively here, as | ||
# a later path prepend of the /scripts directory actually works. | ||
$activateMethod = "call activate" | ||
$requirementSuffix = " --user" | ||
|
||
# on windows only, need to prepend with the scripts directory as well | ||
Write-Host "##vso[task.prependpath]$($env:CONDA)/Scripts" | ||
} | ||
|
||
if("$(PythonVersion)" -eq "pypy3"){ | ||
Write-Host "##vso[task.setvariable variable=PyVersion]-c conda-forge pypy3.7 pip" | ||
} | ||
else { | ||
Write-Host "##vso[task.setvariable variable=PyVersion]python=$(PythonVersion)" | ||
} | ||
|
||
# we will use these variables extensively later | ||
Write-Host "##vso[task.setvariable variable=activate.method]$activateMethod" | ||
Write-Host "##vso[task.setvariable variable=requirement.suffix]$requirementSuffix" | ||
displayName: 'Evaluate OS Specific PATH and Parameters' | ||
|
||
- ${{ each artifact in parameters.CondaArtifacts }}: | ||
# due to the fact that `pypy3` and `conda-build` conda packages are INCOMPATIBLE, we have to create | ||
# a separate env to install `conda-build` and use that to `conda index` the local file channel | ||
- script: | | ||
echo "conda create --name ${{ artifact.name }} $(PyVersion) --yes" | ||
conda create --name ${{ artifact.name }} $(PyVersion) --yes | ||
|
||
echo "conda create --name index-env --yes" | ||
conda create --name index-env --yes | ||
|
||
echo "conda install --name index-env --yes --quiet conda-build" | ||
conda install --name index-env --yes --quiet conda-build | ||
|
||
echo "$(activate.method) index-env" | ||
$(activate.method) index-env | ||
|
||
echo "conda index $(Build.ArtifactStagingDirectory)/${{ artifact.name }}" | ||
conda index $(Build.ArtifactStagingDirectory)/${{ artifact.name }} | ||
displayName: 'Prepare Conda Environment for Testing ${{ artifact.name }}, Index the Target Local Artifact' | ||
|
||
- script: | | ||
echo "$(activate.method) ${{ artifact.name }}" | ||
$(activate.method) ${{ artifact.name }} | ||
|
||
echo "python -m pip install -r eng/ci_tools.txt $(requirement.suffix)" | ||
python -m pip install -r eng/ci_tools.txt $(requirement.suffix) | ||
displayName: 'Activate Conda Environment and Install General Dependencies ${{ artifact.name }}' | ||
|
||
- pwsh: | | ||
mkdir $(Agent.BuildDirectory)/conda/ | ||
Write-Host "##vso[task.setvariable variable=conda.build]$(Agent.BuildDirectory)/conda_checkout" | ||
displayName: 'Create Conda Working Directory for Testing' | ||
|
||
- ${{ each checkout in artifact.checkout }}: | ||
- pwsh: | ||
Write-Host "Clean up Conda Build Directory $(conda.build)" | ||
Remove-Item $(conda.build)/* -Recurse -Force | ||
displayName: 'Clean Up Before Testing ${{ artifact.name }}' | ||
|
||
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml | ||
parameters: | ||
Paths: | ||
- "${{ checkout.checkout_path }}/${{ checkout.package }}" | ||
- "tools/" | ||
Repositories: | ||
- Name: "Azure/azure-sdk-for-python" | ||
Commitish: "${{ checkout.Package }}_${{ checkout.Version }}" | ||
WorkingDirectory: "$(conda.build)" | ||
SkipDefaultCheckout: true | ||
|
||
- script: | | ||
echo "conda install --name ${{ artifact.name }} azure-identity -c $(AzureSDKChannel) --yes" | ||
conda install --name ${{ artifact.name }} azure-identity -c $(AzureSDKChannel) --yes | ||
|
||
echo "conda install --name ${{ artifact.name }} ${{ artifact.name }} -c $(Build.ArtifactStagingDirectory)/${{ artifact.name }} --yes" | ||
conda install --name ${{ artifact.name }} ${{ artifact.name }} -c $(Build.ArtifactStagingDirectory)/${{ artifact.name }} --yes | ||
|
||
echo "$(activate.method) ${{ artifact.name }}" | ||
$(activate.method) ${{ artifact.name }} | ||
|
||
echo "python -m pip install -r $(Build.SourcesDirectory)/eng/conda_test_requirements.txt" | ||
python -m pip install -r $(Build.SourcesDirectory)/eng/conda_test_requirements.txt | ||
displayName: 'Install ${{ checkout.package }} Conda Package and Dev Requirements' | ||
workingDirectory: $(conda.build)/${{ checkout.checkout_path }}/${{ checkout.package }} | ||
|
||
- script: | | ||
echo "$(activate.method) ${{ artifact.name }}" | ||
$(activate.method) ${{ artifact.name }} | ||
python -m pytest . | ||
displayName: 'Run Tests for ${{ checkout.package }}' | ||
workingDirectory: $(conda.build)/${{ checkout.checkout_path }}/${{ checkout.package }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is a script block instead of pwsh it will run on different shells on different OS's and echo is one of the commands that works different on linux vs windows. There is a little more info on why at https://dev.azure.com/azure-sdk/internal/_wiki/wikis/internal.wiki/2/Azure-DevOps-Pipeline-Guidance?anchor=use-full-cmdlet-names-for-better-scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it do differently? It's doing what I expect it to AFAICT.
Example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An extra
"
around it isn't the end of the world IMO.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the extra quote isn't the end of the world but that can start to fall apart when you are doing things like writing setvariable or other things that react different depending on the quoting around it. I know it bit me which is why I wrote about it in the wiki.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I'm only using this to output the command that's being invoked for visibility. Thanks for a heads up on the setvariable stuff especially. Gonna look for any instances of that.