Skip to content

Commit

Permalink
Merge pull request #70 from redBorder/enable_tensorflow_gpu
Browse files Browse the repository at this point in the history
PR-59: Enable GPU Execution
  • Loading branch information
PRodriguezFlores authored May 24, 2024
2 parents 54123ae + cb33668 commit cd50988
Show file tree
Hide file tree
Showing 31 changed files with 890 additions and 658 deletions.
912 changes: 617 additions & 295 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![test](https://github.com/redBorder/rb-aioutliers/actions/workflows/tests.yml/badge.svg?event=push)
![lint](https://github.com/redBorder/rb-aioutliers/actions/workflows/lint.yml/badge.svg?event=push)
![security check](https://github.com/redBorder/rb-aioutliers/actions/workflows/security.yml/badge.svg?event=push)
[![License: GPL v2](https://img.shields.io/badge/License-GPL_v2-blue.svg)](https://www.gnu.org/licenses/gpl-2.0)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![codecov](https://codecov.io/gh/redBorder/rb-aioutliers/graph/badge.svg?token=ZGBCLP3865)](https://codecov.io/gh/redBorder/rb-aioutliers)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FredBorder%2Frb-aioutliers.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FredBorder%2Frb-aioutliers?ref=badge_shield)

Expand Down Expand Up @@ -220,4 +220,4 @@ query=base64_string
- Miguel Álvarez Adsuara <[email protected]>
- Pablo Rodriguez Flores <[email protected]>

LICENSE: GENERAL PUBLIC LICENSE, Version 2, June 1991
LICENSE: AFFERO GENERAL PUBLIC LICENSE, Version 3, 19 November 2007
12 changes: 11 additions & 1 deletion packaging/rpm/rb-aioutliers.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Release: %{__release}%{?dist}
BuildArch: noarch
Summary: RedBorder Python AI Outliers Detection Service

License: GPL-2.0
License: AGPL 3.0
URL: https://github.com/redBorder/rb-aioutliers
Source0: %{name}-%{version}.tar.gz

Expand Down Expand Up @@ -68,6 +68,16 @@ source /opt/rb-aioutliers/aioutliers/bin/activate
# Install project dependencies
pip3 install -r /opt/rb-aioutliers/resources/src/requirements.txt

# Add NVIDIA libraries to LD_LIBRARY_PATH (Necessary for using TensorFlow with GPU)
cp /opt/rb-aioutliers/resources/src/setup_tensorflow_and_cuda.sh /opt/rb-aioutliers/aioutliers/bin/setup_tensorflow_and_cuda.sh

# Append the sourcing of setup script to activate script
echo "source /opt/rb-aioutliers/aioutliers/bin/setup_tensorflow_and_cuda.sh" | tee -a /opt/rb-aioutliers/aioutliers/bin/activate

# Deactivate and reactivate to apply changes
deactivate
source /opt/rb-aioutliers/aioutliers/bin/activate

%changelog
* Tue Jan 30 2024 Miguel Álvarez <[email protected]> - 0.0.3-1
- Adapt for rhel9 build and user/group creation
Expand Down
20 changes: 9 additions & 11 deletions resources/src/__main__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import os
Expand Down
20 changes: 9 additions & 11 deletions resources/src/ai/outliers.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import os
Expand Down
20 changes: 9 additions & 11 deletions resources/src/ai/shallow_outliers.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.

import os
import sys
Expand Down
20 changes: 9 additions & 11 deletions resources/src/ai/trainer.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import os
Expand Down
20 changes: 9 additions & 11 deletions resources/src/config/configmanager.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import configparser
Expand Down
20 changes: 9 additions & 11 deletions resources/src/druid/client.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import requests
Expand Down
20 changes: 9 additions & 11 deletions resources/src/druid/query_builder.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


"""
Expand Down
20 changes: 9 additions & 11 deletions resources/src/logger/logger.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import os
Expand Down
20 changes: 9 additions & 11 deletions resources/src/rbntp/ntplib.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import pytz
Expand Down
20 changes: 9 additions & 11 deletions resources/src/redborder/async_jobs/train_job.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import sys, os, json
Expand Down
20 changes: 9 additions & 11 deletions resources/src/redborder/rq.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
# Copyright (C) 2023 Eneo Tecnologia S.L.
#
# Authors :
# Authors:
# Miguel Álvarez Adsuara <[email protected]>
# Pablo Rodriguez Flores <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
# This program is free software: you can redistribute it and/or modify it under the terms of the
# GNU Affero General Public License as published by the Free Software Foundation, either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Affero General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License along with this program.
# If not, see <https://www.gnu.org/licenses/>.


import sys, os, time
Expand Down
Loading

0 comments on commit cd50988

Please sign in to comment.