GitHub - ldepaula3/apro_flask_azure: Running CMS Risk Adjustment Models Applicat...
source link: https://github.com/ldepaula3/apro_flask_azure
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Running CMS Risk Adjustment Models via API with SAS Analytics Pro (Viya) on Azure
Overview
This repository is an asset for those that want to install and configure SAS Analytics Pro (Viya) on Azure and connect to third party applications via SSH.
Here is what you will be able to accomplish:
- Deploy an Azure instance with Ubuntu
- Install Docker on this instance
- Clone the GitHub repository
- Install SAS Analytics Pro on Viya
- Configure password-less SSH on the SAS Analytics Pro Viya
- Build the container for the Flask application
- Run the Flask application container
- Test password-less SHS from the Flask container to the SAS Analytics Pro on Viya
- Configure ports on the Azure instance to make sure it is accessible from my machine
- Run the application on the browser to score new patients
You can watch the video below for more detailed explanation on each step.
Here it is a overview of this repo.
Installation
1 - Install Docker
** note: execute these commands on the Linux instance command line.
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
2 - Get Project Files
** note: execute this command on the Linux instance command line.
git clone https://github.com/ldepaula3/apro_flask_azure
2.1 - Get your SAS license file (.jwt) and paste inside aprocontainer/sasinside/ directory
3 - Download images from SAS Mirror
** note: execute this command on the Linux instance command line.
sudo docker pull [SAS Mirror]/viya-4-x64_oci_linux_2-docker/sas-analytics-pro:[TAG]
4 - Set Permissions & configure SSH - generate keys
** note: execute these commands on the Linux instance command line.
cd apro_flask_azure
chmod 777 ssh_setup.sh
./ssh_setup.sh
5 - Run SAS Analytics Pro on Viya Container
** note 1: execute these commands on the Linux instance command line. ** note 2: you will have to edit the file launchsas.sh (lines 3 and 11) to match the image mirror, tag and license filename.
cd aprocontainer
./launchsas.sh
sudo docker logs -f sas-analytics-pro
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' sas-analytics-pro
6 - Get inside SAS Analytics Pro on Viya container and set permissions on keys/folders
** note 1: execute these command on the Linux instance command line. ** note 2: it will then login into the container and the next 4 commands are executed inside the sas-analytics-pro container.
sudo docker exec -it sas-analytics-pro bash
su sasdemo
chmod -R 700 /data
cd data/.ssh
chmod 600 authorized_keys id_rsa id_rsa.pub
6.1 (optional) - Test SSH connection
** note: execute these commands inside the sas-analytics-pro container.
ssh localhost
Exit and go back to linux machine where docker is running
7 - Build Simple-Flask container
** note 1: execute these commands on the Linux instance command line.
cd ../simple-flask
sudo docker build --tag python-docker .
8 - Run Simple-Flask Application container
** note 1: execute these commands on the Linux instance command line.
./launchpython.sh
9 - Check if Simple-Flask can connect to SAS Analytics Pro container
** note 1: execute the first command on the Linux instance command line. ** note 2: it will then login into the container and the next 2 commands are executed inside the Simple Flask container. ** note 3: make sure the IP address matches the one on simple-flask/configs/sascfg_personal.py (as we checked on step 5)
docker exec -it [SIMPLE FLASK CONTAINER ID] bash
cd /root/.ssh
ssh [email protected]
10 (optional) - Inspect logs from Simple-Flask container
** note 1: execute this command on the Linux instance command line.
sudo docker logs -f [CONTAINER_ID]
Additional Resources
Recommend
-
15
Deploying Models to Flask A walk-through on how to deploy machine learning models for user interaction using Python and Flask
-
9
A small adjustment to the Poisson model that improves predictions. Posted on August 4, 2018 There are a lot extensions to the basic Poisson model for predicting...
-
13
一文详解bundle adjustment ...
-
5
Best Internal Tool Frameworks for ReactJS In this article, I will talk about new open-source React.js frameworks that will greatly contribute to your project while developing internal-tool applications and make your work easi...
-
3
What is Slowing Down Your Agile Transformation? It Could be Your Legacy Applications Daryl Kulak...
-
6
Running CMS-HCC Risk Adjustment models with SAS Analytics Pro on Viya
-
5
Running CMS Risk Adjustment Models via API with SAS Analytics Pro (Viya) on Azure
-
10
In the SAP Business ByDesign system, you can configure Withholding Tax contents only for SAP country versions. The purpose of this blog is to describe how to use SAP Cloud Applications Studio to configure and use Withholding tax for a country with...
-
8
Xiaomi MIUI system policy adjustment will deny some models testing rights
-
5
Getting Real: The Smarter, Faster, Easier Way to Build a Successful Web Application – David Heinemeier Hansson and Jason Fried “Getting Real: The Smarter, Faster, Easier Way to Build a Successful Web Application” was published...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK