Add schema for new gitlab-ci and cdash additions to environment
This commit is contained in:
		 Scott Wittenburg
					Scott Wittenburg
				
			
				
					committed by
					
						 Todd Gamblin
						Todd Gamblin
					
				
			
			
				
	
			
			
			 Todd Gamblin
						Todd Gamblin
					
				
			
						parent
						
							5f18696169
						
					
				
				
					commit
					73c161b7de
				
			
							
								
								
									
										101
									
								
								lib/spack/docs/example_files/spack.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										101
									
								
								lib/spack/docs/example_files/spack.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,101 @@ | |||||||
|  | spack: | ||||||
|  |   definitions: | ||||||
|  |   - pkgs: | ||||||
|  |     - readline@7.0 | ||||||
|  |   - compilers: | ||||||
|  |     - '%gcc@5.5.0' | ||||||
|  |     - '%gcc@7.3.0' | ||||||
|  |     - '%clang@6.0.0' | ||||||
|  |   - oses: | ||||||
|  |     - os=ubuntu18.04 | ||||||
|  |     - os=centos7 | ||||||
|  |  | ||||||
|  |   specs: | ||||||
|  |   - matrix: | ||||||
|  |     - [$pkgs] | ||||||
|  |     - [$compilers] | ||||||
|  |     - [$oses] | ||||||
|  |     exclude: | ||||||
|  |       - '%gcc@7.3.0 os=centos7' | ||||||
|  |  | ||||||
|  |   mirrors: | ||||||
|  |     cloud_gitlab: https://mirror.spack.io | ||||||
|  |  | ||||||
|  |   compilers: | ||||||
|  |     # The .gitlab-ci.yml for this project picks a Docker container which is | ||||||
|  |     # based on ubuntu18.04 and which already has some compilers configured. | ||||||
|  |     # Here we just add some of the ones which are defined on a different | ||||||
|  |     # builder image. | ||||||
|  |     - compiler: | ||||||
|  |         operating_system: centos7 | ||||||
|  |         modules: [] | ||||||
|  |         paths: | ||||||
|  |           cc: /not/used | ||||||
|  |           cxx: /not/used | ||||||
|  |           f77: /not/used | ||||||
|  |           fc: /not/used | ||||||
|  |         spec: gcc@5.5.0 | ||||||
|  |         target: x86_64 | ||||||
|  |     - compiler: | ||||||
|  |         operating_system: centos7 | ||||||
|  |         modules: [] | ||||||
|  |         paths: | ||||||
|  |           cc: /not/used | ||||||
|  |           cxx: /not/used | ||||||
|  |           f77: /not/used | ||||||
|  |           fc: /not/used | ||||||
|  |         spec: clang@6.0.0 | ||||||
|  |         target: x86_64 | ||||||
|  |  | ||||||
|  |  | ||||||
|  |   gitlab-ci: | ||||||
|  |     mappings: | ||||||
|  |       - spack-cloud-ubuntu: | ||||||
|  |         match: | ||||||
|  |           # these are specs, if *any* match the spec under consideration, this | ||||||
|  |           # 'mapping' will be used to generate the CI job | ||||||
|  |           - os=ubuntu18.04 | ||||||
|  |         runner-attributes: | ||||||
|  |           # 'tags' and 'image' go directly onto the job, 'variables' will | ||||||
|  |           # be added to what we already necessarily create for the job as | ||||||
|  |           # a part of the CI workflow | ||||||
|  |           tags: | ||||||
|  |             - spack-k8s | ||||||
|  |           image: scottwittenburg/spack_builder_ubuntu_18.04 | ||||||
|  |       - spack-cloud-centos: | ||||||
|  |         match: | ||||||
|  |           # these are specs, if *any* match the spec under consideration, this | ||||||
|  |           # 'mapping' will be used to generate the CI job | ||||||
|  |           - 'os=centos7' | ||||||
|  |         runner-attributes: | ||||||
|  |           tags: | ||||||
|  |             - spack-k8s | ||||||
|  |           image: spack/centos:7 | ||||||
|  |       - summit: | ||||||
|  |         match: | ||||||
|  |           - os=rhel7 | ||||||
|  |           - target=power9 | ||||||
|  |           - platform=secret-sauce | ||||||
|  |         runner-attributes: | ||||||
|  |           tags: | ||||||
|  |             # this is a set of tags | ||||||
|  |             - summit | ||||||
|  |             - '{os}-{target}' | ||||||
|  |             - rhel7 | ||||||
|  |             - centos7 | ||||||
|  |             - x86_64 | ||||||
|  |           variables: | ||||||
|  |             SCHEDULER_ARGS: "arg2 arg2" | ||||||
|  |  | ||||||
|  |   cdash: | ||||||
|  |     build-group: Release Testing | ||||||
|  |     url: https://cdash.spack.io | ||||||
|  |     project: Spack Testing | ||||||
|  |     site: Spack AWS Gitlab Instance | ||||||
|  |  | ||||||
|  |   repos: [] | ||||||
|  |   upstreams: {} | ||||||
|  |   modules: | ||||||
|  |     enable: [] | ||||||
|  |   packages: {} | ||||||
|  |   config: {} | ||||||
							
								
								
									
										37
									
								
								lib/spack/spack/schema/cdash.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								lib/spack/spack/schema/cdash.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | |||||||
|  | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other | ||||||
|  | # Spack Project Developers. See the top-level COPYRIGHT file for details. | ||||||
|  | # | ||||||
|  | # SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||||||
|  |  | ||||||
|  | """Schema for cdash.yaml configuration file. | ||||||
|  |  | ||||||
|  | .. literalinclude:: ../spack/schema/cdash.py | ||||||
|  |    :lines: 13- | ||||||
|  | """ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #: Properties for inclusion in other schemas | ||||||
|  | properties = { | ||||||
|  |     'cdash': { | ||||||
|  |         'type': 'object', | ||||||
|  |         'default': {}, | ||||||
|  |         'additionalProperties': False, | ||||||
|  |         'required': ['build-group', 'url', 'project', 'site'], | ||||||
|  |         'patternProperties': { | ||||||
|  |             r'build-group': {'type': 'string'}, | ||||||
|  |             r'url': {'type': 'string'}, | ||||||
|  |             r'project': {'type': 'string'}, | ||||||
|  |             r'site': {'type': 'string'}, | ||||||
|  |         }, | ||||||
|  |     }, | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #: Full schema with metadata | ||||||
|  | schema = { | ||||||
|  |     '$schema': 'http://json-schema.org/schema#', | ||||||
|  |     'title': 'Spack cdash configuration file schema', | ||||||
|  |     'type': 'object', | ||||||
|  |     'additionalProperties': False, | ||||||
|  |     'properties': properties, | ||||||
|  | } | ||||||
							
								
								
									
										78
									
								
								lib/spack/spack/schema/gitlab_ci.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										78
									
								
								lib/spack/spack/schema/gitlab_ci.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,78 @@ | |||||||
|  | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other | ||||||
|  | # Spack Project Developers. See the top-level COPYRIGHT file for details. | ||||||
|  | # | ||||||
|  | # SPDX-License-Identifier: (Apache-2.0 OR MIT) | ||||||
|  |  | ||||||
|  | """Schema for gitlab-ci.yaml configuration file. | ||||||
|  |  | ||||||
|  | .. literalinclude:: ../spack/schema/gitlab_ci.py | ||||||
|  |    :lines: 13- | ||||||
|  | """ | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #: Properties for inclusion in other schemas | ||||||
|  | properties = { | ||||||
|  |     'gitlab-ci': { | ||||||
|  |         'type': 'object', | ||||||
|  |         'default': {}, | ||||||
|  |         'additionalProperties': False, | ||||||
|  |         'required': ['mappings'], | ||||||
|  |         'patternProperties': { | ||||||
|  |             r'mappings': { | ||||||
|  |                 'type': 'array', | ||||||
|  |                 'default': {}, | ||||||
|  |                 'additionalProperties': False, | ||||||
|  |                 'patternProperties': { | ||||||
|  |                     r'[\w\d\-_\.]+': { | ||||||
|  |                         'type': 'object', | ||||||
|  |                         'default': {}, | ||||||
|  |                         'additionalProperties': False, | ||||||
|  |                         'required': ['match', 'runner-attributes'], | ||||||
|  |                         'properties': { | ||||||
|  |                             'match': { | ||||||
|  |                                 'type': 'array', | ||||||
|  |                                 'default': [], | ||||||
|  |                                 'items': { | ||||||
|  |                                     'type': 'string', | ||||||
|  |                                 }, | ||||||
|  |                             }, | ||||||
|  |                             'runner-attributes': { | ||||||
|  |                                 'type': 'object', | ||||||
|  |                                 'default': {}, | ||||||
|  |                                 'additionalProperties': True, | ||||||
|  |                                 'required': ['tags'], | ||||||
|  |                                 'properties': { | ||||||
|  |                                     'image': {'type': 'string'}, | ||||||
|  |                                     'tags': { | ||||||
|  |                                         'type': 'array', | ||||||
|  |                                         'default': [], | ||||||
|  |                                         'items': {'type': 'string'} | ||||||
|  |                                     }, | ||||||
|  |                                     'variables': { | ||||||
|  |                                         'type': 'object', | ||||||
|  |                                         'default': {}, | ||||||
|  |                                         'patternProperties': { | ||||||
|  |                                             r'[\w\d\-_\.]+': { | ||||||
|  |                                                 'type': 'string', | ||||||
|  |                                             }, | ||||||
|  |                                         }, | ||||||
|  |                                     }, | ||||||
|  |                                 }, | ||||||
|  |                             }, | ||||||
|  |                         }, | ||||||
|  |                     }, | ||||||
|  |                 }, | ||||||
|  |             }, | ||||||
|  |         }, | ||||||
|  |     }, | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | #: Full schema with metadata | ||||||
|  | schema = { | ||||||
|  |     '$schema': 'http://json-schema.org/schema#', | ||||||
|  |     'title': 'Spack gitlab-ci configuration file schema', | ||||||
|  |     'type': 'object', | ||||||
|  |     'additionalProperties': False, | ||||||
|  |     'properties': properties, | ||||||
|  | } | ||||||
| @@ -10,8 +10,10 @@ | |||||||
| """ | """ | ||||||
| from llnl.util.lang import union_dicts | from llnl.util.lang import union_dicts | ||||||
|  |  | ||||||
|  | import spack.schema.cdash | ||||||
| import spack.schema.compilers | import spack.schema.compilers | ||||||
| import spack.schema.config | import spack.schema.config | ||||||
|  | import spack.schema.gitlab_ci | ||||||
| import spack.schema.mirrors | import spack.schema.mirrors | ||||||
| import spack.schema.modules | import spack.schema.modules | ||||||
| import spack.schema.packages | import spack.schema.packages | ||||||
| @@ -21,8 +23,10 @@ | |||||||
|  |  | ||||||
| #: Properties for inclusion in other schemas | #: Properties for inclusion in other schemas | ||||||
| properties = union_dicts( | properties = union_dicts( | ||||||
|  |     spack.schema.cdash.properties, | ||||||
|     spack.schema.compilers.properties, |     spack.schema.compilers.properties, | ||||||
|     spack.schema.config.properties, |     spack.schema.config.properties, | ||||||
|  |     spack.schema.gitlab_ci.properties, | ||||||
|     spack.schema.mirrors.properties, |     spack.schema.mirrors.properties, | ||||||
|     spack.schema.modules.properties, |     spack.schema.modules.properties, | ||||||
|     spack.schema.packages.properties, |     spack.schema.packages.properties, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user