Merge pull request #113 from jodh-intel/add-ci-scripts

CI: Add CI scripts
This commit is contained in:
James O. D. Hunt 2019-08-29 17:32:24 +01:00 committed by GitHub
commit 39031521f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 115 additions and 26 deletions

25
.ci/lib.sh Normal file
View File

@ -0,0 +1,25 @@
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
export tests_repo="${tests_repo:-github.com/kata-containers/tests}"
export tests_repo_dir="$GOPATH/src/$tests_repo"
clone_tests_repo()
{
# KATA_CI_NO_NETWORK is (has to be) ignored if there is
# no existing clone.
if [ -d "$tests_repo_dir" -a -n "$KATA_CI_NO_NETWORK" ]
then
return
fi
go get -d -u "$tests_repo" || true
}
run_static_checks()
{
clone_tests_repo
bash "$tests_repo_dir/.ci/static-checks.sh" "github.com/kata-containers/community"
}

11
.ci/run.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
# No explicit tests currently
true

17
.ci/setup.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
clone_tests_repo
pushd "${tests_repo_dir}"
.ci/setup.sh
popd

12
.ci/static-checks.sh Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
set -e
cidir=$(dirname "$0")
source "${cidir}/lib.sh"
run_static_checks

21
.travis.yml Normal file
View File

@ -0,0 +1,21 @@
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
dist: xenial
language: go
go:
- master
before_install:
- ".ci/setup.sh"
before_script:
- ".ci/static-checks.sh"
script:
- ".ci/run.sh"

View File

@ -289,11 +289,10 @@ anomalies of CI test failures.
helps us to identify "flaky" tests and prioritize the problematic bugs that helps us to identify "flaky" tests and prioritize the problematic bugs that
make review/merges slower. make review/merges slower.
Use the following link to search all issues (open and closed) and look for the Search for the key failure message in all issues (open and closed) before you
key failure message before you raise an issue. This allows you to see if the raise an issue. This allows you to see if the issue has been raised before:
issue has been raised before:
- https://github.com/issues?utf8=%E2%9C%93&q=is%3Aissue+org%3Akata-containers+ - https://github.com/kata-containers
Enter an error message in the search box and press enter. Enter an error message in the search box and press enter.

View File

@ -51,7 +51,7 @@ The first steps performed by the VMT are:
For some lower-risk issues or problems which may only be easy to solve in future releases, the KCSA Issue will be set to *Opinion* and the core security reviewers for Kata Containers will be subscribed to determine whether they wish to issue a Kata Containers Security Note (KCSN) (these reports may still sometimes remain under embargo until the KCSN is issued). For some lower-risk issues or problems which may only be easy to solve in future releases, the KCSA Issue will be set to *Opinion* and the core security reviewers for Kata Containers will be subscribed to determine whether they wish to issue a Kata Containers Security Note (KCSN) (these reports may still sometimes remain under embargo until the KCSN is issued).
If no KCSA is warranted and there is no benefit to a KCSN then the KCSA Issue will be set to *Won't Fix* or *Invalid* (depending on the specific situation) and the bug state switched from *Private Security* to *Public*, optionally adding the *security* bug tag if the report concerns a potential security hardening opportunity. If no KCSA is warranted and there is no benefit to a KCSN then the KCSA Issue will be set to *Won't Fix* or *Invalid* (depending on the specific situation) and the bug state switched from *Private Security* to *Public*, optionally adding the *security* bug tag if the report concerns a potential security hardening opportunity.
If a Kata Containers Security Note ([KCSN](templates/KCSN.md)) is warranted, one should be written and posted to the [Kata Containers Security Note](https://github.com/kata-containers/documentation/security/KCSN.md) document. If a Kata Containers Security Note (KCSN) is warranted, one should be written and posted to the [Kata Containers Security Note](templates/KCSN.md) document.
The specifics are indexed in the [report taxonomy](#incident-report-taxonomy) and [task status](#kcsa-task-status) tables. The specifics are indexed in the [report taxonomy](#incident-report-taxonomy) and [task status](#kcsa-task-status) tables.

View File

@ -28,7 +28,7 @@ of the Community README.
The election process begins three calendar weeks prior to the election. The election process begins three calendar weeks prior to the election.
- One week for candidates to submit their candidacy - One week for candidates to submit their candidacy
- One week "debate period" for electorate to pose questions on the community - One week "debate period" for electorate to pose questions on the community
mailing lists to learn the candidates' platforms mailing lists to learn the candidates platforms
- One week for voting - One week for voting
- Results announced - Results announced
@ -42,7 +42,7 @@ Committee elections.
## Candidacy ## Candidacy
Anyone who has made contributions to the Kata Containers project is eligible Anyone who has made contributions to the Kata Containers project is eligible
to run. Candidates submit their candidacy by adding a textfile to the to run. Candidates submit their candidacy by adding a text file to the
corresponding election folder under the community repo with their interest corresponding election folder under the community repo with their interest
and platform, and announcing their candidacy on the [community developer mailing and platform, and announcing their candidacy on the [community developer mailing
list](http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev). list](http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev).
@ -76,7 +76,7 @@ Containers project. This includes, but is not limited to:
## System ## System
The Architecture Committee election uses The Architecture Committee election uses
[CIVS with condorcet method voting](https://civs.cs.cornell.edu/) [CIVS with Condorcet method voting](https://civs.cs.cornell.edu/)
## Tools ## Tools

View File

@ -1,9 +1,9 @@
# Architecture Committee Elections: September 2018 # Architecture Committee Elections: September 2018
There are three Architecture Committee seats up for election. The seats up for There are three Architecture Committee seats up for election. The seats up for
election are currently filled by Wei Zhang, Tim Allclair, and Jessie Frazelle. election are currently filled by `Wei Zhang`, `Tim Allclair`, and `Jessie Frazelle`.
Refer to the [elections folder README.md](https://github.com/kata-containers/community/tree/master/elections) Refer to the [elections folder README](https://github.com/kata-containers/community/tree/master/elections)
for election process, declaring candidacy, and eligible voters. for election process, declaring candidacy, and eligible voters.
Election Dates: Election Dates:

View File

@ -1,9 +1,9 @@
# Architecture Committee Elections: March 2019 # Architecture Committee Elections: March 2019
There are two Architecture Committee seats up for election. The seats up for There are two Architecture Committee seats up for election. The seats up for
election are currently filled by Xu Wang and Samuel Ortiz. election are currently filled by `Xu Wang` and `Samuel Ortiz`.
Refer to the [elections folder README.md](https://github.com/kata-containers/community/tree/master/elections) Refer to the [elections folder README](https://github.com/kata-containers/community/tree/master/elections)
for election process, declaring candidacy, and eligible voters. for election process, declaring candidacy, and eligible voters.
Election Dates: Election Dates:

View File

@ -2,8 +2,8 @@
Two nominations were received for the March 2019 elections: Two nominations were received for the March 2019 elections:
- [Samuel Ortiz](https://github.com/sameo) - [`Samuel Ortiz`](https://github.com/sameo)
- [Xu Wang](https://github.com/gnawux) - [`Xu Wang`](https://github.com/gnawux)
As the number of applications matched the number of available seats, the As the number of applications matched the number of available seats, the
question and voting phases of the elections were bypassed, and the two question and voting phases of the elections were bypassed, and the two

View File

@ -1,17 +1,17 @@
# Election Tools # Election Tools
This directory contains the tools required to generate the kata electorate This directory contains the tools required to generate the Kata Containers electorate
## generate_electorate.py ## `generate_electorate.py`
This tool needs the following python libraries: This tool needs the following python libraries:
* pytz * `pytz`
* github3.py * `github3.py`
* pyyaml * `pyyaml`
to install them in a virtual environment do something like: To install them in a virtual environment do something like:
```bash ```bash
$ python3 -m venv .venv $ python3 -m venv .venv
@ -21,14 +21,17 @@ $ .venv/bin/pip install pytz github3.py pyyaml
Before running the tool you will need to create a Before running the tool you will need to create a
[GitHub API token](https://github.blog/2013-05-16-personal-api-tokens/) [GitHub API token](https://github.blog/2013-05-16-personal-api-tokens/)
replace ``__API_TOKEN__`` with your personal token. replace `__API_TOKEN__` with your personal token.
Also update the election start and end times. Then run the tool with: Also update the election start and end times. Then run the tool with:
``$ .venv/bin/python ./generate_electorate.py``
The code looks at all commits in all kata-containers repos *except* ```
kata-containers/linux and kata-containers/qemu. As both of these are forks $ .venv/bin/python ./generate_electorate.py
(in the GitHub sense) they'll have lots of contributors that may not be kata ```
The code looks at all commits in all Kata Containers repos *except*
`kata-containers/linux` and `kata-containers/qemu`. As both of these are forks
(in the GitHub sense) they'll have lots of contributors that may not be Kata
contributors. contributors.
For contributors that have more than one email address it picks one as default For contributors that have more than one email address it picks one as default
@ -38,5 +41,6 @@ emails.
The sources for email addresses are: The sources for email addresses are:
* GitHub account * GitHub account
* Git commit data * Git commit data
* Look for a 'Signed-Off-By' line in the commit message * Look for a `Signed-Off-By` line in the commit message
The GitHub login is always stored so that is the primary identifier. The GitHub login is always stored so that is the primary identifier.