Last active
October 19, 2018 19:58
-
-
Save b0noI/1dd43053f680f4ab55ec5c44b2142d55 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| git clone https://github.com/b0noI/gcp-gpu-utilization-metrics.git | |
| cd gcp-gpu-utilization-metrics | |
| git checkout 6e62ea324bf097817474b51119786e8222dd9fdf | |
| pip install -r ./requirenments.txt | |
| cp ./report_gpu_metrics.py /root/report_gpu_metrics.py | |
| cat <<-EOH > /lib/systemd/system/gpu_utilization_agent.service | |
| [Unit] | |
| Description=GPU Utilization Metric Agent | |
| [Service] | |
| Type=simple | |
| PIDFile=/run/gpu_agent.pid | |
| ExecStart=/bin/bash --login -c '/usr/bin/python /root/report_gpu_metrics' | |
| User=root | |
| Group=root | |
| WorkingDirectory=/ | |
| Restart=always | |
| [Install] | |
| WantedBy=multi-user.target | |
| EOH | |
| systemctl daemon-reload | |
| service start_gpu_agent start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment