Skip to content

Commit fcadc27

Browse files
authored
CI/CD: Update CI/CD to fix documentation and update version (#52)
* Replace windows documentation generation by Linux one * build -> _build (documentation folder that is built) * condition: eq(1,2) to run only doc generation * Remove conditions * Upgrade version to 0.2.2 * Fix prepare-linux-environment * display windows environment
1 parent d3fa0a0 commit fcadc27

File tree

4 files changed

+94
-26
lines changed

4 files changed

+94
-26
lines changed

.ci/azure-pipelines.yml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -148,45 +148,45 @@ jobs:
148148

149149
- template: templates\kill-servers-linux.yml
150150

151-
- job: DocumentationWindows
151+
- job: DocumentationLinux
152152
variables:
153-
python.version: '3.8'
154-
DISPLAY: ':99.0'
153+
python.version: '3.7' # due to VTK 8.1.2 requirement for docbuild
155154
PYANSYS_OFF_SCREEN: True
156-
DPF_PORT: 32772
155+
DPF_PORT: 50055
156+
TEMP: $(System.DefaultWorkingDirectory)/temp
157+
AWP_ROOT212: $(System.DefaultWorkingDirectory)/server/v212
157158
GH_DOC_BRANCH: 'gh-pages'
159+
158160
pool:
159-
vmImage: 'windows-2019'
161+
vmImage: 'ubuntu-20.04'
162+
steps:
163+
- template: templates\prepare-environment-linux.yml
160164

161-
steps:
162-
- template: templates\prepare-environment-windows.yml
163-
164165
- script: |
165-
pip install -r requirements_docs.txt
166-
cd .ci
167-
dir
168-
set THISDIR=$(System.DefaultWorkingDirectory)
169-
set AWP_ROOT212=%THISDIR%\server\v212
170-
ECHO %AWP_ROOT212%
171-
build_doc.bat
166+
pip install -r requirements_docs.txt
167+
displayName: Install documentation packages for Python
168+
169+
- script: |
170+
sphinx-apidoc -o docs/source/api ansys -f --implicit-namespaces --separate --no-headings
171+
xvfb-run make -C docs html SPHINXOPTS="-w build_errors.txt -N"
172172
displayName: Build Documentation
173-
173+
174174
- task: ArchiveFiles@2
175175
inputs:
176-
rootFolderOrFile: '$(System.DefaultWorkingDirectory)\docs\_build'
176+
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/docs/_build'
177177
includeRootFolder: false
178178
archiveType: 'zip'
179-
archiveFile: '$(System.DefaultWorkingDirectory)\docs\archive\doc-ansys-dpf-post.zip'
179+
archiveFile: '$(System.DefaultWorkingDirectory)/docs/archive/doc-ansys-dpf-post.zip'
180180
replaceExistingArchive: true
181181
displayName: 'DOCUMENTATION: zip artifacts'
182182

183183
- task: PublishBuildArtifacts@1
184184
displayName: 'DOCUMENTATION: publish artifacts'
185185
inputs:
186-
PathtoPublish: '$(System.DefaultWorkingDirectory)\docs\archive'
186+
PathtoPublish: '$(System.DefaultWorkingDirectory)/docs/archive'
187187
ArtifactName: doc-ansys-dpf-post
188-
enabled: true
189-
188+
enabled: true
189+
190190
- powershell: |
191191
git init
192192
git checkout -b $(GH_DOC_BRANCH)
@@ -196,13 +196,13 @@ jobs:
196196
git add .
197197
git commit -m "Documentation generated by $(Build.DefinitionName)"
198198
displayName: "Init git and add docs"
199-
workingDirectory: docs\_build\html
199+
workingDirectory: docs/_build/html
200200
201201
- script: |
202202
git remote add origin https://$(GH_PAT)@github.com/pyansys/DPF-Post-docs
203203
git push -u origin $(GH_DOC_BRANCH) --force
204204
displayName: "Publish GitHub Pages merge commit"
205-
workingDirectory: docs\_build\html
205+
workingDirectory: docs/_build/html
206206
condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
207-
208-
- template: templates\kill-servers-windows.yml
207+
208+
- template: templates\kill-servers-linux.yml
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
steps:
2+
- task: UsePythonVersion@0
3+
inputs:
4+
versionSpec: "$(python.version)"
5+
displayName: "Use Python $(python.version)"
6+
7+
- task: PipAuthenticate@1
8+
inputs:
9+
artifactFeeds: "pyansys"
10+
onlyAddExtraIndex: true
11+
12+
- script: |
13+
sudo apt update
14+
sudo apt install zip pandoc libgl1-mesa-glx xvfb
15+
displayName: Install OS packages
16+
17+
- script: |
18+
pip install -r .ci/requirements_test_xvfb.txt
19+
xvfb-run python .ci/display_test.py
20+
displayName: Test virtual framebuffer
21+
22+
- script: |
23+
pip install -r requirements_build.txt
24+
python setup.py bdist_wheel
25+
export WHEELNAME=`ls dist/*.whl`
26+
echo ${WHEELNAME}
27+
pip install ${WHEELNAME}
28+
cd tests
29+
xvfb-run python -c "from ansys.dpf import post; print(post.Report())"
30+
displayName: Install ansys-dpf-post
31+
32+
- task: UniversalPackages@0
33+
inputs:
34+
command: "download"
35+
downloadDirectory: "$(System.DefaultWorkingDirectory)"
36+
feedsToUse: "internal"
37+
vstsFeed: "705e121a-9631-49f5-8aaf-c7142856f923"
38+
vstsFeedPackage: "dpf-linux" #TODO: update hash of packages
39+
vstsPackageVersion: "21.2.5"
40+
displayName: Download DPF linux package
41+
42+
- script: |
43+
echo $0
44+
if pgrep -x "Ans.Dpf.Grpc" > /dev/null
45+
then
46+
pkill -f Ans.Dpf.Grpc.exe
47+
fi
48+
displayName: "Kill all servers"
49+
condition: always()
50+
continueOnError: true
51+
52+
- script: |
53+
env
54+
displayName: Display env
55+
56+
- script: |
57+
cd ${AWP_ROOT212}/aisol/bin/linx64
58+
pwd
59+
chmod 755 Ans.Dpf.Grpc.sh
60+
chmod 755 Ans.Dpf.Grpc.exe
61+
./Ans.Dpf.Grpc.sh --port 50054 & > log.txt
62+
export DPF_IP=$(hostname -i)
63+
python -c "from ansys.dpf import core; core.connect_to_server(ip= '${DPF_IP}', port=50054); print('Python Connected')"
64+
displayName: Start DPF Server

.ci/templates/prepare-environment-windows.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
steps:
2+
- script: |
3+
env
4+
displayName: Display env
5+
26
- powershell: |
37
Set-StrictMode -Version Latest
48
$ErrorActionPreference = "Stop"

ansys/dpf/post/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Version for ansys-dpf-post"""
22
# major, minor, patch
3-
version_info = 0, 2, 0
3+
version_info = 0, 2, 2
44

55
# Nice string for the version
66
__version__ = ".".join(map(str, version_info))

0 commit comments

Comments
 (0)