Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
86a6fe4
Create r.yml
sujaykhandekar Jul 30, 2021
2b463c4
Update r.yml
sujaykhandekar Jul 30, 2021
579b123
Update FetchBeerRatings.R
sujaykhandekar Jul 30, 2021
06fad36
Update CreatePADS.R
sujaykhandekar Jul 30, 2021
af99900
Update CreatePADS.R
sujaykhandekar Jul 30, 2021
c30f7f4
Update r.yml
sujaykhandekar Jul 30, 2021
95a8e1d
Update r.yml
sujaykhandekar Jul 30, 2021
1356790
Update r.yml
sujaykhandekar Jul 30, 2021
e750f6f
Update r.yml
sujaykhandekar Jul 30, 2021
b8f6d37
Update ClassifyData.R
sujaykhandekar Jul 30, 2021
7eb63cc
Update r.yml
sujaykhandekar Jul 30, 2021
d5bc592
Delete r.yml
sujaykhandekar Aug 1, 2021
90ef026
Create r.yml
sujaykhandekar Aug 1, 2021
3b8d0a5
Update r.yml
sujaykhandekar Aug 1, 2021
1311d65
Update r.yml
sujaykhandekar Aug 1, 2021
8c7034a
Update r.yml
sujaykhandekar Aug 1, 2021
2561e26
Update r.yml
sujaykhandekar Aug 1, 2021
61b42f7
Update r.yml
sujaykhandekar Aug 1, 2021
aaa712a
Update r.yml
sujaykhandekar Aug 1, 2021
4fa20c8
Update r.yml
sujaykhandekar Aug 2, 2021
74188ff
Update DefaultChartForPAD.R
sujaykhandekar Aug 2, 2021
9accfb9
Update r.yml
sujaykhandekar Aug 2, 2021
4d0ee05
Update r.yml
sujaykhandekar Aug 2, 2021
d93924c
Update r.yml
sujaykhandekar Aug 2, 2021
d898495
Update r.yml
sujaykhandekar Aug 2, 2021
0dcd94e
Update r.yml
sujaykhandekar Aug 2, 2021
d89b81d
Update r.yml
sujaykhandekar Aug 2, 2021
13dcf4d
Update r.yml
sujaykhandekar Aug 2, 2021
17154c1
Update r.yml
sujaykhandekar Aug 2, 2021
6194130
Update r.yml
sujaykhandekar Aug 2, 2021
ebc1cae
Update r.yml
sujaykhandekar Aug 2, 2021
9b4d8b0
added sh file
sujaykhandekar Aug 3, 2021
26f8d63
Update deploy_to_aws.sh
sujaykhandekar Aug 3, 2021
876ffbc
Update r.yml
sujaykhandekar Aug 3, 2021
282861e
Update ClassifyData.R
sujaykhandekar Aug 3, 2021
d9c69c8
Merge pull request #1 from sujaykhandekar/sujaykhandekar-patch-1
sujaykhandekar Aug 3, 2021
aeae799
Update r.yml
sujaykhandekar Aug 4, 2021
6f8a659
Update deploy_to_aws.sh
sujaykhandekar Aug 5, 2021
8fe3177
Update r.yml
sujaykhandekar Aug 5, 2021
1297f89
Update ClassifyData.R
sujaykhandekar Aug 5, 2021
f018a39
Merge pull request #3 from sujaykhandekar/sujaykhandekar-patch-1
sujaykhandekar Aug 5, 2021
5dfb06d
Update r.yml
sujaykhandekar Aug 5, 2021
702ba99
Merge pull request #4 from sujaykhandekar/sujaykhandekar-patch-1-1
sujaykhandekar Aug 5, 2021
96332bf
Update deploy_to_aws.sh
sujaykhandekar Aug 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/r.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy EC2
on:
push:
branches:
- master
pull_request:
types: [closed]
jobs:
merge-PR:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.EC2_SSH_KEY }}
name: id_rsa
known_hosts: ${{ secrets.KNOWN_HOSTS }}
- name: rsync over ssh
run: ./deploy_to_aws.sh
10 changes: 5 additions & 5 deletions ClassifyData.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
# Copyright (c) 2011, under the Creative Commons Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0) License
# For more information see: https://creativecommons.org/licenses/by-nc/3.0/
# All rights reserved.


# new addition
#cool

#
# Generate extra date cols
#
generateExtraDateCols <- function(data, col.index) {
lMonths <- c("January","February","March", "April","May","June","July","August","September", "October","November","December")
generateExtraDateCols < function(data, col.index)
lMonths <- c("January","February","March", "April,"May","June","July","August","September", "October","November","December")
lDays <- c("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")
#data$Day_generated=factor(weekdays(data[,col.index]), levels=lDays, ordered=TRUE)
data$Day_g=factor(weekdays(data[,col.index]), levels=lDays)
Expand Down Expand Up @@ -264,4 +264,4 @@ testClassification <- function() {
#
#`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]

}
}
8 changes: 4 additions & 4 deletions CreatePADS.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ loadStates <- function(){
#
# Initialize Padification Process
#
initializeSystem <- function(stack=0){
initializeSystem <- function(stack=0{

# turn off scientific formatting - getOption("scipen")
options(scipen=999)
options(scipen=999;

# day and months facors
lMonths <- c("January","February","March", "April","May","June","July","August","September", "October","November","December")
Expand All @@ -87,7 +87,7 @@ initializeSystem <- function(stack=0){
assign("lDays", lDays, envir=.GlobalEnv)

#loadStates
loadStates()
loadStates(

#initialize solr docs
#assign("solr.index.docs", list(), envir=.GlobalEnv)
Expand Down Expand Up @@ -278,4 +278,4 @@ padify <- function(series, series.data, x.plot.band=NULL, y.plot.band=NULL){
# "subcategory"=pmd$subcategory, "tags"=pmd$tags, "author"="system")
# solr.index.docs[[length(solr.index.docs)+1]] <<- doc
}
}
}
2 changes: 1 addition & 1 deletion DefaultChartForPAD.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Get default info for pad
#
getDefault <- function(){
return(list(dim="", mea="", size="", yaxis=list(), xaxis=list(), chart=list()))
return(list(dim="", mea="", size="", yaxis=list(), xaxis=list(), chart=list())
}

#
Expand Down
4 changes: 2 additions & 2 deletions FetchData/FetchBeerRatings.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For more information see: https://creativecommons.org/licenses/by-nc/3.0/
# All rights reserved.
require(data.table)
startup <- function() {
startup <- function( {
#initialize system
initializeSystem(0)

Expand Down Expand Up @@ -43,4 +43,4 @@ setkey(beer.data, beer_beerid)
b.d.500 <- beer.data[, list(no_of_reviews=nrow(.SD)), by=beer_beerid][no_of_reviews >= 500]
setkey(b.d.500, beer_beerid)
#merge to get all records ofbeers which have 500 or more reviews
b.d.500 <- merge(b.d.500, beer.data, all=F)
b.d.500 <- merge(b.d.500, beer.data, all=F)
10 changes: 10 additions & 0 deletions deploy_to_aws.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
echo 'Starting to Deploy...'
ssh ubuntu@3.234.99.37 -i ~/.ssh/id_rsa " sudo docker image prune -f
cd /newstorage/users/sujay/R_check
sudo docker-compose down
git fetch origin
git reset --hard origin && echo 'You are doing well'
sudo docker-compose build && sudo docker-compose up -d
"
echo 'Deployment completed successfully'