-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #720 from MetaCell/feature/CH-37
Allow to clone an external repo before the build
- Loading branch information
Showing
24 changed files
with
560 additions
and
14 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
.travis.yaml | ||
.openapi-generator-ignore | ||
README.md | ||
tox.ini | ||
git_push.sh | ||
test-requirements.txt | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
venv/ | ||
.python-version | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
#Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
.git |
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,3 @@ | ||
node_modules | ||
dist | ||
.git |
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 |
---|---|---|
|
@@ -69,3 +69,5 @@ target/ | |
|
||
#Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
.git |
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,73 @@ | ||
node_modules | ||
dist | ||
.travis.yaml | ||
.openapi-generator-ignore | ||
README.md | ||
tox.ini | ||
git_push.sh | ||
test-requirements.txt | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
venv/ | ||
.python-version | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
#Ipython Notebook | ||
.ipynb_checkpoints | ||
|
||
.git |
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,91 @@ | ||
# Application dependencies | ||
|
||
Application dependencies can be specified in the main application configuration | ||
file (deploy/values.yaml), in the `harness` section. | ||
|
||
Example: | ||
```yaml | ||
harness: | ||
dependencies: | ||
build: | ||
- cloudharness-base | ||
soft: | ||
- app1 | ||
hard: | ||
- accounts | ||
git: | ||
- url: https://github.com/a/b.git | ||
branch_tag: master | ||
``` | ||
## Build dependencies | ||
Build dependencies specify which images must be built before the current one. | ||
Currently only base images and common images can be used as a build dependency. | ||
See also [base and common images documentation](../base-common-images.md). | ||
## Soft dependencies | ||
Soft dependencies specify other applications (from your app or cloudharness) that | ||
must be included in the deployment together with your application, | ||
but are not a prerequisite for the application to bootstrap and serve basic functionality. | ||
Soft dependencies are implicitly chained: if *A1* depends on *A2* and *A2* depends on *A3*, | ||
all *A1*, *A2*, *A3* are included in the deployment if A1 is requested (say with | ||
`harness-deployment ... -i A1`). | ||
|
||
## Hard dependencies | ||
|
||
Hard dependencies work similarly to soft dependencies but they are required for the | ||
application declaring the dependency to start and provide even basic functionality. | ||
|
||
With a hard dependency, we are allowed to assume that the other application exists in the | ||
configuration and during the runtime. | ||
|
||
Note that Cloud Harness does not guarantee the the other application starts before the | ||
application declaring the dependency because that's how Kubernetes works. The application | ||
is supposed to crash in the absence of its dependency and Kubernetes will start the crash | ||
loop until both applications are settled. | ||
|
||
## Git (repository) dependencies | ||
|
||
Git dependencies allow us to build and deploy applications that are defined in another repository. | ||
This functionality is an alternative to the otherwise monorepo-centric view of CloudHarness-based | ||
applications. | ||
|
||
The repository is cloned before the build within skaffold build and the CI/CD inside the | ||
`dependencies` directory at the same level of the Dockerfile. | ||
|
||
Hence, in the Dockerfile we are allowed to `COPY` or `ADD` the repository. | ||
|
||
For instance, given the following configuration: | ||
```yaml | ||
harness: | ||
dependencies: | ||
git: | ||
- url: https://github.com/a/b.git | ||
branch_tag: master | ||
- url: https://github.com/c/d.git | ||
branch_tag: v1.0.0 | ||
path: myrepo | ||
``` | ||
|
||
The directory structure will be as following: | ||
``` | ||
Dockerfile | ||
dependencies | ||
b.git | ||
myrepo | ||
.dockerignore | ||
``` | ||
|
||
Hence, inside the Dockerfile we expect to see something like | ||
|
||
```dockerfile | ||
COPY dependencies . | ||
COPY dependencies/b.git/src . | ||
COPY dependencies/myrepo . | ||
``` | ||
|
||
> Note that Cloud Harness does not add the COPY/ADD statements to the Dockerfile |
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,19 @@ | ||
# cloudharness_model.model.git_dependency_config.GitDependencyConfig | ||
|
||
Defines a git repo to be cloned inside the application path | ||
|
||
## Model Type Info | ||
Input Type | Accessed Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
dict, frozendict.frozendict, | frozendict.frozendict, | Defines a git repo to be cloned inside the application path | | ||
|
||
### Dictionary Keys | ||
Key | Input Type | Accessed Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ------------- | ||
**branch_tag** | str, | str, | | | ||
**url** | str, | str, | | | ||
**path** | str, | str, | Defines the path where the repo is cloned. default: /git | [optional] | ||
**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] | ||
|
||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) | ||
|
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
Oops, something went wrong.