Skip to content

Commit f386ca0

Browse files
author
Beat Buesser
committed
Merge remote-tracking branch 'origin/main' into dev_1.11.1
2 parents 6e47deb + 020280c commit f386ca0

File tree

6 files changed

+76
-54
lines changed

6 files changed

+76
-54
lines changed

.github/workflows/dockerhub.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
# GitHub recommends pinning actions to a commit SHA.
7+
# To get a newer version, you will need to update the SHA.
8+
# You can also reference a tag or branch, but the action may change without warning.
9+
name: Publish Docker image
10+
11+
on:
12+
# Run on manual trigger
13+
workflow_dispatch:
14+
15+
release:
16+
types: [published]
17+
18+
jobs:
19+
push_to_registry:
20+
name: Push Docker image to Docker Hub
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Check out the repo
24+
uses: actions/checkout@v3
25+
26+
- name: Log in to Docker Hub
27+
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
28+
with:
29+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
30+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
31+
32+
- name: Extract metadata (tags, labels) for Docker
33+
id: meta
34+
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a
35+
with:
36+
images: adversarialrobustnesstoolbox/releases
37+
tags: |
38+
type=raw,value={{branch}}-1.11.0-{{sha}}
39+
type=semver,pattern={{version}}
40+
41+
- name: Build and push Docker image
42+
uses: docker/build-push-action@c84f38281176d4c9cdb1626ffafcd6b3911b5d94
43+
with:
44+
context: .
45+
push: true
46+
tags: ${{ steps.meta.outputs.tags }}
47+
labels: ${{ steps.meta.outputs.labels }}

Dockerfile

Lines changed: 16 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,25 @@
1-
FROM tensorflow/tensorflow:2.2.0
2-
RUN pip3 install keras==2.3.1
3-
#### NOTE: comment these two lines if you wish to use the tensorflow 1 version of ART instead ####
4-
#FROM tensorflow/tensorflow:1.15.2
5-
#RUN pip3 install keras==2.2.5
1+
FROM nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu20.04
62

7-
RUN pip3 install numpy==1.19.1 scipy==1.4.1 matplotlib==3.3.1 scikit-learn==0.22.2 six==1.15.0 Pillow==7.2.0 pytest-cov==2.10.1
8-
RUN pip3 install tqdm==4.48.2 statsmodels==0.11.1 pydub==0.24.1 resampy==0.2.2 ffmpeg-python==0.2.0 cma==3.0.3 mypy==0.770
9-
RUN pip3 install ffmpeg-python==0.2.0
10-
RUN pip3 install pandas==1.1.1
3+
RUN apt-get update -y
4+
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
5+
RUN apt-get install -y python3 python3-distutils python3-pip
116

12-
#TODO check if jupyter notebook works
13-
RUN pip3 install jupyter==1.0.0 && pip3 install jupyterlab==2.1.0
14-
# https://stackoverflow.com/questions/49024624/how-to-dockerize-jupyter-lab
7+
RUN pip3 install tensorflow==2.9.1 keras==2.9.0 numpy==1.22.4 scipy==1.8.1 matplotlib==3.5.2 scikit-learn==1.1.2 \
8+
six==1.15.0 Pillow==9.2.0 pytest-cov==3.0.0 tqdm==4.64.0 statsmodels==0.13.2 pydub==0.25.1 \
9+
resampy==0.3.1 ffmpeg-python==0.2.0 cma==3.2.2 pandas==1.4.3 h5py==3.7.0 tensorflow-addons==0.17.1 \
10+
mxnet==1.6.0 torch==1.12.0 torchaudio==0.12.0 torchvision==0.13.0 catboost==1.0.6 GPy==1.10.0 \
11+
lightgbm==3.3.2 xgboost==1.6.1 kornia==0.6.6 lief==0.12.1 pytest==7.1.2 pytest-pep8==1.0.6 \
12+
pytest-mock==3.8.2 codecov==2.1.12 requests==2.28.1
1513

16-
# Lingvo ASR dependencies
17-
# supported versions: (lingvo==0.6.4 with tensorflow-gpu==2.1.0)
18-
# note: due to conflicts with other TF1/2 version supported by ART, the dependencies are not installed by default:
19-
# Replace line 1 with: FROM tensorflow/tensorflow:2.1.0
20-
# Comment other TF related lines and uncomment:
21-
# RUN pip3 install tensorflow-gpu==2.1.0
22-
# RUN pip3 install lingvo==0.6.4
14+
RUN apt-get -y install ffmpeg libavcodec-extra vim git
2315

24-
RUN pip3 install h5py==2.10.0
25-
RUN pip3 install tensorflow-addons==0.11.1
26-
RUN pip3 install mxnet==1.6.0
27-
RUN pip3 install torch==1.5.0 torchvision==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
28-
RUN pip3 install catboost==0.24
29-
RUN pip3 install GPy==1.9.9
30-
RUN pip3 install lightgbm==2.3.1
31-
RUN pip3 install xgboost==1.1.1
32-
RUN pip3 install kornia==0.3.1
33-
34-
RUN pip3 install lief==0.11.4
35-
36-
RUN pip3 install pytest==5.4.1 pytest-pep8==1.0.6 pytest-mock==3.2.0 codecov==2.1.8 requests==2.24.0
37-
38-
RUN mkdir /project; mkdir /project/TMP
39-
VOLUME /project/TMP
16+
RUN mkdir /project
4017
WORKDIR /project
41-
42-
# IMPORTANT: please double check that the dependencies above are up to date with the following requirements file. We currently still run pip install on dependencies within requirements_test.txt in order to keep dependencies in agreement (in the rare cases were someone updated the requirements_test.txt file and forgot to update the dockefile)
43-
ADD . /project/
44-
RUN pip3 install --upgrade -r /project/requirements_test.txt
45-
46-
RUN apt-get update
47-
RUN apt-get -y -q install ffmpeg libavcodec-extra
18+
ADD . /project
19+
RUN pip3 install .
4820

4921
RUN echo "You should think about possibly upgrading these outdated packages"
5022
RUN pip3 list --outdated
5123

52-
EXPOSE 8888
53-
54-
CMD bash run_tests.sh
55-
56-
#Check the Dockerfile here https://www.fromlatest.io/#/
57-
58-
#NOTE to contributors: When changing/adding packages, please make sure that the packages are consistent with those
59-
# present within the requirements_test.txt files
24+
# NOTE to contributors: When changing/adding packages, please make sure that the packages are consistent with those
25+
# present within the requirements_test.txt files

README-cn.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@
1919
[![Downloads](https://pepy.tech/badge/adversarial-robustness-toolbox/month)](https://pepy.tech/project/adversarial-robustness-toolbox)
2020
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/5090/badge)](https://bestpractices.coreinfrastructure.org/projects/5090)
2121

22+
<p align="center">
23+
<img src="https://raw.githubusercontent.com/lfai/artwork/master/lfaidata-assets/lfaidata-project-badge/graduate/color/lfaidata-project-badge-graduate-color.png" alt="LF AI & Data" width="300"/>
24+
</p>
2225

23-
对抗性鲁棒性工具集(ART)是用于机器学习安全性的Python库。ART提供的工具可
26+
对抗性鲁棒性工具集(ART)是用于机器学习安全性的Python库。ART 由
27+
[Linux Foundation AI & Data Foundation](https://lfaidata.foundation) (LF AI & Data)。 ART提供的工具可
2428
帮助开发人员和研究人员针对以下方面捍卫和评估机器学习模型和应用程序:
2529
逃逸,数据污染,模型提取和推断的对抗性威胁。ART支持所有流行的机器学习框架
2630
(TensorFlow,Keras,PyTorch,MXNet,scikit-learn,XGBoost,LightGBM,CatBoost,GPy等),所有数据类型

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@
2121

2222
[中文README请按此处](README-cn.md)
2323

24-
Adversarial Robustness Toolbox (ART) is a Python library for Machine Learning Security. ART provides tools that enable
24+
<p align="center">
25+
<img src="https://raw.githubusercontent.com/lfai/artwork/master/lfaidata-assets/lfaidata-project-badge/graduate/color/lfaidata-project-badge-graduate-color.png" alt="LF AI & Data" width="300"/>
26+
</p>
27+
28+
Adversarial Robustness Toolbox (ART) is a Python library for Machine Learning Security. ART is hosted by the
29+
[Linux Foundation AI & Data Foundation](https://lfaidata.foundation) (LF AI & Data). ART provides tools that enable
2530
developers and researchers to defend and evaluate Machine Learning models and applications against the
2631
adversarial threats of Evasion, Poisoning, Extraction, and Inference. ART supports all popular machine learning frameworks
2732
(TensorFlow, Keras, PyTorch, MXNet, scikit-learn, XGBoost, LightGBM, CatBoost, GPy, etc.), all data types

examples/get_started_tensorflow_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
The script demonstrates a simple example of using ART with TensorFlow v1.x. The example train a small model on the MNIST
2+
The script demonstrates a simple example of using ART with TensorFlow v2.x. The example train a small model on the MNIST
33
dataset and creates adversarial examples using the Fast Gradient Sign Method. Here we use the ART classifier to train
44
the model, it would also be possible to provide a pretrained model to the ART classifier.
55
The parameters are chosen for reduced computational requirements of the script and not optimised for accuracy.

requirements_test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# base
22

3-
numpy>=1.18.5
3+
numpy>=1.18.5,<=1.22
44
scipy==1.8.1
55
matplotlib==3.5.2
66
scikit-learn>=0.22.2,<1.2.0

0 commit comments

Comments
 (0)