Skip to content

Commit 4be8d50

Browse files
authored
Merge branch 'keras-team:master' into electra
2 parents f53b9db + 4511580 commit 4be8d50

File tree

130 files changed

+7709
-10257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+7709
-10257
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ updates:
2121
python:
2222
patterns:
2323
- "*"
24+
ignore:
25+
# ignore all updates for JAX GPU due to cuda version issue
26+
- dependency-name: "jax[cuda12_pip]"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: auto-assignment
2+
on:
3+
issues:
4+
types:
5+
- opened
6+
7+
permissions:
8+
contents: read
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
welcome:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/github-script@v7
18+
with:
19+
script: |
20+
const script = require('./\.github/workflows/scripts/auto-assignment.js')
21+
script({github, context})

.github/workflows/labeler.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2024 Google LLC. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
# This workflow automatically identifies issues and pull requests (PRs)
17+
# related to Gemma. It searches for the keyword "Gemma" (case-insensitive)
18+
# in both the title and description of the issue/PR. If a match is found,
19+
# the workflow adds the label 'Gemma' to the issue/PR.
20+
21+
name: 'Labeler'
22+
on:
23+
issues:
24+
types: [edited, opened]
25+
pull_request_target:
26+
types: [opened, edited]
27+
28+
permissions:
29+
contents: read
30+
issues: write
31+
pull-requests: write
32+
33+
jobs:
34+
welcome:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: actions/github-script@v7
39+
with:
40+
script: |
41+
const script = require('./\.github/workflows/scripts/labeler.js')
42+
script({github, context})
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/** Automatically assign issues and PRs to users in the `assigneesList`
2+
* on a rotating basis.
3+
4+
@param {!object}
5+
GitHub objects can call GitHub APIs using their built-in library functions.
6+
The context object contains issue and PR details.
7+
*/
8+
9+
module.exports = async ({ github, context }) => {
10+
let issueNumber;
11+
let assigneesList;
12+
// Is this an issue? If so, assign the issue number. Otherwise, assign the PR number.
13+
if (context.payload.issue) {
14+
//assignee List for issues.
15+
assigneesList = ["SuryanarayanaY", "sachinprasadhs"];
16+
issueNumber = context.payload.issue.number;
17+
} else {
18+
//assignee List for PRs.
19+
assigneesList = [mattdangerw];
20+
issueNumber = context.payload.number;
21+
}
22+
console.log("assignee list", assigneesList);
23+
console.log("entered auto assignment for this issue: ", issueNumber);
24+
if (!assigneesList.length) {
25+
console.log("No assignees found for this repo.");
26+
return;
27+
}
28+
let noOfAssignees = assigneesList.length;
29+
let selection = issueNumber % noOfAssignees;
30+
let assigneeForIssue = assigneesList[selection];
31+
32+
console.log(
33+
"issue Number = ",
34+
issueNumber + " , assigning to: ",
35+
assigneeForIssue
36+
);
37+
return github.rest.issues.addAssignees({
38+
issue_number: context.issue.number,
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
assignees: [assigneeForIssue],
42+
});
43+
};
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
Copyright 2024 Google LLC. All Rights Reserved.
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
*/
15+
16+
17+
/**
18+
* Invoked from labeler.yaml file to add
19+
* label 'Gemma' to the issue and PR for which have gemma keyword present.
20+
* @param {!Object.<string,!Object>} github contains pre defined functions.
21+
* context Information about the workflow run.
22+
*/
23+
24+
module.exports = async ({ github, context }) => {
25+
const issue_title = context.payload.issue ? context.payload.issue.title : context.payload.pull_request.title
26+
let issue_description = context.payload.issue ? context.payload.issue.body : context.payload.pull_request.body
27+
const issue_number = context.payload.issue ? context.payload.issue.number : context.payload.pull_request.number
28+
const keyword_label = {
29+
gemma:'Gemma'
30+
}
31+
const labelsToAdd = []
32+
console.log(issue_title,issue_description,issue_number)
33+
if (issue_description==null)
34+
{
35+
issue_description = ''
36+
}
37+
38+
for(const [keyword, label] of Object.entries(keyword_label)){
39+
if(issue_title.toLowerCase().indexOf(keyword) !=-1 || issue_description.toLowerCase().indexOf(keyword) !=-1 ){
40+
console.log(`'${keyword}'keyword is present inside the title or description. Pushing label '${label}' to row.`)
41+
labelsToAdd.push(label)
42+
}
43+
}
44+
if(labelsToAdd.length > 0){
45+
console.log(`Adding labels ${labelsToAdd} to the issue '#${issue_number}'.`)
46+
github.rest.issues.addLabels({
47+
owner: context.repo.owner,
48+
repo: context.repo.repo,
49+
issue_number: context.issue.number,
50+
labels: labelsToAdd
51+
})
52+
}
53+
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Close inactive issues
2+
on:
3+
schedule:
4+
- cron: "30 1 * * *"
5+
jobs:
6+
close-issues:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
issues: write
10+
pull-requests: write
11+
steps:
12+
- name: Awaiting response issues
13+
uses: actions/stale@v9
14+
with:
15+
days-before-issue-stale: 14
16+
days-before-issue-close: 14
17+
stale-issue-label: "stale"
18+
# reason for closed the issue default value is not_planned
19+
close-issue-reason: completed
20+
only-labels: "stat:awaiting response from contributor"
21+
stale-issue-message: >
22+
This issue is stale because it has been open for 14 days with no activity.
23+
It will be closed if no further activity occurs. Thank you.
24+
# List of labels to remove when issues/PRs unstale.
25+
labels-to-remove-when-unstale: "stat:awaiting response from contributor"
26+
close-issue-message: >
27+
This issue was closed because it has been inactive for 28 days.
28+
Please reopen if you'd like to work on this further.
29+
days-before-pr-stale: 14
30+
days-before-pr-close: 14
31+
stale-pr-message: "This PR is stale because it has been open for 14 days with no activity. It will be closed if no further activity occurs. Thank you."
32+
close-pr-message: "This PR was closed because it has been inactive for 28 days. Please reopen if you'd like to work on this further."
33+
repo-token: ${{ secrets.GITHUB_TOKEN }}
34+
- name: Contribution issues
35+
uses: actions/stale@v9
36+
with:
37+
days-before-issue-stale: 180
38+
days-before-issue-close: 365
39+
stale-issue-label: "stale"
40+
# reason for closed the issue default value is not_planned
41+
close-issue-reason: not_planned
42+
any-of-labels: "stat:contributions welcome,good first issue"
43+
# List of labels to remove when issues/PRs unstale.
44+
labels-to-remove-when-unstale: "stat:contributions welcome,good first issue"
45+
stale-issue-message: >
46+
This issue is stale because it has been open for 180 days with no activity.
47+
It will be closed if no further activity occurs. Thank you.
48+
close-issue-message: >
49+
This issue was closed because it has been inactive for more than 1 year.
50+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.kokoro/github/ubuntu/gpu/build.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
set -e
2-
set -x
32

4-
cd "${KOKORO_ROOT}/"
3+
export KAGGLE_KEY="$(cat ${KOKORO_KEYSTORE_DIR}/73361_keras_kaggle_secret_key)"
4+
export KAGGLE_USERNAME="$(cat ${KOKORO_KEYSTORE_DIR}/73361_keras_kaggle_username)"
5+
6+
if [[ -z "${KAGGLE_KEY}" ]]; then
7+
echo "KAGGLE_KEY is NOT set"
8+
exit 1
9+
fi
510

6-
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
11+
if [[ -z "${KAGGLE_USERNAME}" ]]; then
12+
echo "KAGGLE_USERNAME is NOT set"
13+
exit 1
14+
fi
15+
16+
set -x
17+
cd "${KOKORO_ROOT}/"
718

819
PYTHON_BINARY="/usr/bin/python3.9"
920

.kokoro/github/ubuntu/gpu/jax/continuous.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,23 @@ env_vars: {
1212
value: "jax"
1313
}
1414

15+
before_action {
16+
fetch_keystore {
17+
keystore_resource {
18+
keystore_config_id: 73361
19+
keyname: "keras_kaggle_username"
20+
}
21+
}
22+
}
23+
24+
before_action {
25+
fetch_keystore {
26+
keystore_resource {
27+
keystore_config_id: 73361
28+
keyname: "keras_kaggle_secret_key"
29+
}
30+
}
31+
}
32+
1533
# Set timeout to 60 mins from default 180 mins
1634
timeout_mins: 60

.kokoro/github/ubuntu/gpu/jax/presubmit.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,23 @@ env_vars: {
1212
value: "jax"
1313
}
1414

15+
before_action {
16+
fetch_keystore {
17+
keystore_resource {
18+
keystore_config_id: 73361
19+
keyname: "keras_kaggle_username"
20+
}
21+
}
22+
}
23+
24+
before_action {
25+
fetch_keystore {
26+
keystore_resource {
27+
keystore_config_id: 73361
28+
keyname: "keras_kaggle_secret_key"
29+
}
30+
}
31+
}
32+
1533
# Set timeout to 60 mins from default 180 mins
1634
timeout_mins: 60

.kokoro/github/ubuntu/gpu/keras2/continuous.cfg

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,23 @@ env_vars: {
1212
value: "1"
1313
}
1414

15+
before_action {
16+
fetch_keystore {
17+
keystore_resource {
18+
keystore_config_id: 73361
19+
keyname: "keras_kaggle_username"
20+
}
21+
}
22+
}
23+
24+
before_action {
25+
fetch_keystore {
26+
keystore_resource {
27+
keystore_config_id: 73361
28+
keyname: "keras_kaggle_secret_key"
29+
}
30+
}
31+
}
32+
1533
# Set timeout to 60 mins from default 180 mins
1634
timeout_mins: 60

0 commit comments

Comments
 (0)