forked from cloudbase/cloudbase-init
-
Notifications
You must be signed in to change notification settings - Fork 3
Added PS script to build cloudbase-init from sources #1
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
Open
ader1990
wants to merge
26
commits into
master
Choose a base branch
from
build_from_source_cbsinit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
8371520
Added PS script to build cloudbase-init from sources
ader1990 8d7f31b
Fixed empty args
ader1990 9051283
Hacks to make embed python work
ader1990 94c20bd
added easy install wheel and pip from sources
ader1990 f528805
Addde pip / wheel params for sources
ader1990 2d528fa
Parameterize python version header
ader1990 9c462c0
Update the bdist_wininst.py from the embedded version with the full one
ader1990 9bd4000
Removed hardcoded py prefix
ader1990 9790f7c
Build dll lib from the existend python dll
ader1990 3df14c6
fix some comments
ader1990 22ab71d
Uncomment Setup-PythonPip
ader1990 93bed4b
Fixed some new lines and updated readme
ader1990 e13e131
Added support to build Python from sources
ader1990 dc0b987
Added better parameters and cleanup noop
ader1990 1cb3a43
Fix readme headers
ader1990 7add7f0
Fixes after refactor
ader1990 0cfdc7d
Added test config for empty metadata source
ader1990 668a528
Added proper cleanup for the build artifacts
ader1990 0779fa5
Added how to for Python from source / embedded
ader1990 bf6746e
Added base usage
ader1990 e15079c
Use python directly for install and cleanup pip cache dir
ader1990 e77d758
Removed Embedded python install
ader1990 6def5c0
Merge pull request #2 from ader1990/build_from_source_cbsinit_devel
ader1990 315d643
Set Windows SDK to 8.1 using vcvarsall
ader1990 1a1ba6f
Add parameter to remove unnecessary executables
ader1990 2935d70
Add flag to remove adodbapi from pywin32 code
ader1990 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 hidden or 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,61 @@ | ||
| ### Requirements ### | ||
|
|
||
| #### Clean Windows Server 2016 / 2019 or Windows 10 install with latest updates | ||
|
|
||
| #### Python installed and added to path (with pip installed) if PythonOrigin is set to AlreadyInstalled. | ||
| Download link: https://www.python.org/ftp/python/3.7.7/python-3.7.7-amd64.exe | ||
|
|
||
| #### Visual Studio 2015 Community installed, with the following components: | ||
| - Programming Languages -> Visual C++ (all) | ||
| - Windows and Web Development -> Windows 8.1 (only Tools and Windows SDKs) | ||
|
|
||
| VS 2015 Download page (you need to be logged in to access it): https://visualstudio.microsoft.com/vs/older-downloads/ | ||
| If you prefer to not build pywin32, Visual Studio 2017 / 2019 can be used too. | ||
| Reboot after VS installation is complete. | ||
|
|
||
| #### To build Python from source, Visual Studio 2017 Community installed with the following components: | ||
| - VC++ 2017 v141 | ||
| - Windows 10 SDK (10.0.14393.0). This version of VS supports Python 3.8 build too. | ||
|
|
||
| #### All the Python packages will be built and installed using pip flags: "--no-binary :all:" | ||
|
|
||
| #### The full build of cloudbase-init (and dependencies) using Python from source takes around 20 minutes. | ||
|
|
||
| #### How to run: | ||
|
|
||
|
|
||
| ```powershell | ||
| # install Cloudbase-Init using Python already installed (Python and Python scripts folders should be added to path). | ||
| .\build_install_from_sources.ps1 | ||
|
|
||
| # install Cloudbase-Init using Python from source (tag v3.7.7) | ||
| .\build_install_from_sources.ps1 -PythonOrigin FromSource -PythonVersion "v3.7.7" | ||
|
|
||
| # full command line | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd put the full command line after the other basic examples |
||
| .\build_install_from_sources.ps1 ` | ||
| -CloudbaseInitRepoUrl "https://github.com/cloudbase/cloudbase-init" ` | ||
| -PyWin32RepoUrl "https://github.com/mhammond/pywin32" ` | ||
| -PyMiRepoUrl "https://github.com/cloudbase/PyMI" ` | ||
| -PythonOrigin "AlreadyInstalled" ` | ||
| -PythonVersion "v3.7.7" ` | ||
| -SetuptoolsUrl "https://github.com/pypa/setuptools" ` | ||
| -PipSourceUrl "https://github.com/pypa/pip/archive/20.0.2.tar.gz" ` | ||
| -WheelSourceUrl "https://github.com/pypa/wheel/archive/0.34.2.tar.gz" `, | ||
| -CleanBuildArtifacts:$false, | ||
| -RemoveUnnecessaryExecutables:$false, | ||
| -RemovePyWin32Adodbapi:$false, | ||
| -BuildDir "build" | ||
| ``` | ||
|
|
||
|
|
||
| #### Workflow of the script: | ||
| - Download and set pip upper requirements from OpenStack | ||
| - Create / clean temporary build directory | ||
| - If PythonOrigin="AlreadyInstalled" is set, do nothing. Python should be already installed and added to path. | ||
| - If PythonOrigin="FromSource" is set, download the Python source from GitHub, build, prepare it and add it to path. Setuptools, pip and wheel will be built from source and installed. | ||
| - Build and install PyWin32 from sources | ||
| - Build and install PyMI from sources | ||
| - Build, install and create Cloudbase-Init binary from sources | ||
| - If CleanBuildArtifacts is set and PythonOrigin is FromSource, cleanup the .pdb, .pyc, header files. | ||
| - If RemoveUnnecessaryExecutables is set and PythonOrigin is FromSource, remove the .exe files (excluding python.exe, setuptools/pip/wheel and cloudbase-init.exe). | ||
| - If RemovePyWin32Adodbapi is set, remove the Adodbapi sources and references from PyWin32 source code | ||
Oops, something went wrong.
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.
7-zip is also needed