environment setup

 2.Install Software

1. JDK

Install JDK. Currently, JDK 8 is used.

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

  1. Find out the path JDK 1.8 is installed

    $ which java
    /Library/Java/JavaVirtualMachines/jdk1. 8 .0_112.jdk/Contents/Home/bin/java
  2. Set environment variables

    $ cd ~
    $ vi .bash_profile
    ...
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1. 8 .0_112.jdk/Contents/Home
    PATH=$JAVA_HOME/bin:$PATH
      
    :wq!
    $ source .bash_profile
  3. Check Java version

    $ java -version
    java version  "1.8.0_112"
    Java(TM) SE Runtime Environment (build  1.8 .0_112-b16)
    Java HotSpot(TM)  64 -Bit Server VM (build  25.112 -b16, mixed mode)

2. Git

Install git:  https://git-scm.com/downloads

FYI: http://learngitbranching.js.org/  if you want to know more about git commands

  1. Check if git is installed successfully

    $ git --version
    15 : 19 : 37.961988  git.c: 344                trace: built-in: git  'version'
    git version  2.7 . 4  (Apple Git- 66 )
  2. Define basic git config settings

    git config --global user.name  "[your userid]"
    git config --global user.email  "[your userid]@coupang.com"
    git config --global core.precomposeunicode  true
    git config --global core.autocrlf  false
    git config --global core.filemode  false

3. Database (MySQL)

  1. Download and Setup
    OS X: Local development Divi install - Mac (Local DB Installation for Mac OS)
  2. Setup in ~/.bash_profile file

    alias mysql=/usr/local/mysql/bin/mysql
    alias mysqladmin=/usr/local/mysql/bin/mysqladmin
    export PATH=$PATH:/usr/local/mysql/bin
  3. DB user, schemas setup (ods, fds)          

Need to log in as root user to perform the following steps.

  • Log in as root user:

mysql -u root -p'password'       (replace with actual root password)

OR

mysql -u root -p                        (type in password once prompt)

  • Create Users
Create Users:
CREATE USER  'coupang' @ 'localhost'  IDENTIFIED BY  'test' ;
CREATE USER  'winter' @ 'localhost'  IDENTIFIED BY  'test' ;
CREATE USER  'summer' @ 'localhost'  IDENTIFIED BY  'test' ;
Create databases:
CREATE DATABASE `fds` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
CREATE DATABASE `ods` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
Grant Permissions:
USE mysql;
INSERT INTO db (HOST, Db, USER, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Index_priv, Alter_priv) 
    VALUES( 'localhost' , 'fds' , 'coupang' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' );
INSERT INTO db (HOST, Db, USER, Select_priv, Insert_priv, Update_priv, Delete_priv, Create_priv, Drop_priv, Index_priv, Alter_priv)
    VALUES( 'localhost' , 'ods' , 'coupang' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' );
     INSERT INTO db (HOST,Db,USER,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv, Alter_priv)
        VALUES( 'localhost' , 'fds' , 'winter' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' );
     INSERT INTO db (HOST,Db,USER,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv, Alter_priv)
        VALUES( '10.%.%.%' , 'fds' , 'winter' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' );
     INSERT INTO db (HOST,Db,USER,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv, Alter_priv)
        VALUES( 'localhost' , 'fds' , 'summer' , 'Y' , 'Y' , 'Y' , 'Y' , 'N' , 'N' , 'N' , 'N' );
     INSERT INTO db (HOST,Db,USER,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv, Alter_priv)
        VALUES( '10.%.%.%' , 'fds' , 'summer' , 'Y' , 'Y' , 'Y' , 'Y' , 'N' , 'N' , 'N' , 'N' );
     INSERT INTO db (HOST,Db,USER,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv, Alter_priv)
        VALUES( 'localhost' , 'ods' , 'winter' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' );
     INSERT INTO db (HOST,Db,USER,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv, Alter_priv)
        VALUES( '10.%.%.%' , 'ods' , 'winter' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' );
     INSERT INTO db (HOST,Db,USER,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv, Alter_priv)
        VALUES( 'localhost' , 'ods' , 'summer' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' );
     INSERT INTO db (HOST,Db,USER,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_priv, Alter_priv)
        VALUES( '10.%.%.%' , 'ods' , 'summer' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' , 'Y' );
 
FLUSH PRIVILEGES;

Note: if the insert statement execution doesn’t work, don’t copy/paste.  Type it out.  It may be related to the single quote issue.

In case you need to uninstall MySQL, you can follow the Solution at the bottom of this website. http://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x

4. Tomcat

  1. Download Tomcat
    http://tomcat.apache.org/download-80.cgi
    Click the tar.gz link under "Core" section.
     
  2. Extract it at the folder you prefer. (e.g. /usr/local/) 

    tar -zxvf apache-tomcat- 8.5 . 9 .tar
  3. Setup links

    sudo rm -f /Library/Tomcat
    sudo ln -s /usr/local/apache-tomcat- 8.5 . 9  /Library/Tomcat
    sudo chown -R [the userid you setup on Mac] /Library/Tomcat
    sudo chmod +x /Library/Tomcat/bin/*.sh
  4. Setup environment variables in ~/.bash_profile file

    export CATALINA_HOME=/usr/local/apache-tomcat- 8.5 . 9
    PATH=$CATALINA_HOME/bin:$JAVA_HOME/bin:$PATH
  5. Commands to start/stop servers

    /Library/Tomcat/bin/startup.sh
    /Library/Tomcat/bin/shutdown.sh
5. IntelliJ

NOTE:  If you are out of office, make sure you connect to VPN environment.

  1. Download IntelliJ
    Http://www.jetbrains.com/idea/download/index.html 

    Download the Ultimate Edition.  (Note:  I downloaded the version 14.x.x.  I also download the latest version (15.x) but it does't work when I inserted the License Server)
  2. Apply License Activation
    In the first screen "Register Click" 
    Open or the development environment IntelliJ then Menu> Help> Register Click
    A popup will display with title "IntelliJ License Server"
    Select "License Server" radio button.
    License Server Address:  http://xxx()
  3. Setup IntelliJ VM properties
    Edit the file /Applications/IntelliJ IDEA 14.app/Contents/bin/idea.vmoptions
    Make changes as shown below

    -Xms128m
    -Xmx2048m
    -XX: MaxPermSize = 350m
    -XX:ReservedCodeCacheSize=96m
    -XX:+UseCodeCacheFlushing
    -she
    -Dsum.io.useCanonCache= false
    -Djava.net.preferIPv4Stack= true

    After saving the changes, copy this file to ~/Library/Preferences/IntelliJIdeaXX/idea.vmoptions

  4. Clone the (DFS) project
    After installation, you can create project by checking out from Version Control.  (If you are in the Welcome to IntelliJ IDEA popup, you may select clone the project from Version Control.)
    Select git.
    Fill out the information in the Clone Repository Popup



    In case there is a popup of 'Import Project', select 'Gradle'.  Click <OK> to take the default 

    File > Project > Project SDK: set to JDK 1.8 && Project Language Level:  Set to 8.0 


  5. Configurations
    After your project is imported/cloned successfully AND it connects to git version control, perform the followings:

    IntelliJ IDEA > Preferences

    Select Plugins.  Install the followings:
      Lombok
      Python
      Eclipse Code Formatter
      Handlebars/Mustache

    After installation, it will ask you to restart IntelliJ.  Go ahead to restart IntelliJ.



    Select Compiler and update the followings:
       Resource Patterns:  Add "logback*.groovy"
       Build Process Heap Size: 1024


    Select 'Annotation Processors' and check the checkbox of 'Enable annotation processing'



    Select 'File Encodings' and modify the followings:
      Default encoding for properties files:  UTF-8
      Transparent native-to-ascii conversion:  Checked


    Select 'Gradle' and update the followings:
      Gradle VM options:  -Dfile.encoding=UTF-8
      Use auto-import:  Checked


    Search 'File and Code Templates'.  Select 'Includes' tab and select 'File Header'.  Update the following:

    /**
      * User: your userid (your email address)
      * Date: ${DATE}
      * Time: ${TIME}
      */
  6. Go to terminal window.  Open the file /etc/hosts.  Add the following line:

    127.0.0.1       local.coupang.com

6.Installing RabbitMQ

The following step is required for running the development server. The instruction seems to require installing Erlang, but I noticed it was already included using the homebrew method to install RabbitMQ.

You will see the following error if RabbitMQ is not setup when running tomcat.

Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.coupang.rabbitkeeper.RabbitKeeper

6.1 Create Local RabbitMQ user

cd $RABBITMQ_HOME/$VERSION/sbin

rabbitmqctl add_user coupang coupang
rabbitmqctl set_user_tags coupang administrator
rabbitmqctl set_permissions -p / coupang ".*" ".*" ".*"

7.key.dat

Unzip the file.  For the local environment, put the unzipped file under the path /usr/local/coupang/.  Read/write permissions at the 'coupang' directory is required.

Note:  "root" is used to create the folder 'coupang' and own the file.

3.DB table & testing data setup

Run below gradle tasks one by one to create table and testing data:

./gradlew :fraud-detector-domain:flywayClean -Pprofile.flyway=develop
./gradlew :fraud-detector-domain:flywayInit -Pprofile.flyway=develop
./gradlew :fraud-detector-domain:flywayMigrate -Pprofile.flyway=develop

 

4.FDS Tomcat server configuration

1, IntelliJ IDEA > Edit Configurations > Click + on the left top > Select Tomcat Server(Local) 

2, Server tab configuration

  • Name: any unique name is ok, e.g. FDS

  • Application server:  Configure to the tomcat server which you installed previously
  • VM options: 

    -Dfile.encoding=UTF- 8
    -Xmx1024m
    -XX:PermSize=64m
    -XX:MaxPermSize=256m
    -Dspring.profiles.active=integration 
    -Dasset.timestamp.generator=LOCAL_TIME
    -Dconfig.override=classpath:vitamin/properties/project-develop-override.xml

 

 

 

3, "Deployment" tab configuration

  • Click + at "Deploy at the server startup"

  • Select "Artifact..."

  • Select "fraud-detector-interfaces.war(exploded)"

  • Click "OK"

4, Start server

When server is up, go to http://local.coupang.com:8080/

Issue: For newer IntelliJ version ( 2016), you might run into the problem of local hostname unknown. Simply using this command to fix it: 

echo "127.0.0.1 $HOSTNAME" | sudo tee -a /etc/hosts

5.Batch configurations

example to configure two key batches

  1. SpringMainBatch
  • Click Run > Edit Configurations
  • Click + at the left top of the pop up window
  • Select 'Application'
  • Fill followings to the pop up window

               Name: SpringMainBatch

               Main class: com.coupang.batch.SpringBatchManager

               VM options:

-Xms256m
-Xmx1024m
-XX:MaxPermSize=512m 
-Dspring.profiles.active=integration
-DbatchContextConfig=com.coupang.frauddetector.domain.batch.configuration.FraudDetectorBatchContextConfig
-Dconfig.override=classpath:vitamin/properties/project-integration-override.xml

 

 

       2. SpringMainBatchFrequent

  • Click Run > Edit Configurations
  • Click + at the left top of the pop up window
  • Select 'Application'
  • Fill followings to the pop up window

               Name: SpringMainBatchFrequent

               Main class: com.coupang.batch.SpringBatchManager

               VM options:

-Xms256m
-Xmx1024m
-XX:MaxPermSize=512m 
-Dspring.profiles.active=develop
-DbatchContextConfig=com.coupang.frauddetector.domain.batch.configuration.FraudDetectorBatchContextConfig 
-Dconfig.override=classpath:vitamin/properties/project-develop-override.xml

 

6.Learning Materials

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: fmdide_setup是指FMDIDE软件的安装设置过程。FMDIDE是一款功能强大的集成开发环境(IDE),专门设计用于FPGA设计和开发。 在进行fmdide_setup之前,我们首先需要下载FMDIDE软件的安装包。一般而言,官方网站或相关论坛会提供可靠的下载源。下载完成后,我们双击安装包进行解压缩,然后进入解压后的文件夹。 接下来,我们需要找到一个名为"fmdide_setup.exe"的可执行文件。我们点击该文件并按照软件安装向导的指示进行安装。 安装向导通常会要求我们选择安装路径和相关组件。我们可以根据自己的需要选择合适的路径,也可以选择默认路径。在选择组件时,一般建议选择完全安装,以确保软件的正常运行。 安装完成后,我们可以在选择的安装路径中找到FMDIDE的可执行文件。我们双击该文件,启动FMDIDE软件。在首次运行之前,我们可能需要进行一些初始设置。这些设置包括选择语言、配置编译器、指定目标硬件等。根据具体需求进行设置,并保存更改。 完成初始设置后,我们就可以开始使用FMDIDE进行FPGA设计和开发工作了。通过FMDIDE,我们可以创建新项目、导入现有项目、编写代码、进行仿真、调试等一系列开发工作。 总之,fmdide_setup是指安装和设置FMDIDE软件的过程。通过正确安装并设置FMDIDE,我们可以充分发挥FPGA开发的潜力,快速、高效地进行硬件设计和开发。 ### 回答2: fmdide_setup是一个软件安装程序,用于安装FMDIDE(FluxMag Design Integrated Development Environment)集成开发环境。FMDIDE是一款用于设计和开发电磁感应器的软件工具。 安装fmdide_setup首先需要下载安装程序。用户可以从FMDIDE官方网站上找到下载链接并选择与其操作系统兼容的版本。一旦下载完成,用户需要运行安装程序。 安装程序将引导用户完成安装过程。用户应该仔细阅读每个安装步骤,并根据自己的需要进行选择。通常情况下,用户只需要按照默认设置进行安装即可。 安装过程中,用户可以选择软件的安装路径和相关组件的安装选项。用户还可以选择是否在开始菜单、桌面或快捷方式中创建软件的快捷方式。 安装完成后,用户可以通过开始菜单、桌面或快捷方式启动FMDIDE。一旦启动,用户可以开始使用该集成开发环境来设计和开发电磁感应器。 总之,fmdide_setup是一个用于安装FMDIDE集成开发环境的软件安装程序。通过安装程序,用户可以方便地安装FMDIDE并开始使用该软件进行电磁感应器的设计和开发。 ### 回答3: fmdide_setup是一个软件安装程序,用于安装和配置名为FMDIDE的集成开发环境(IDE)。FMDIDE是一款用于开发和编程的工具,主要用于创建和编辑各种软件应用程序和计算机程序。 使用fmdide_setup,用户可以轻松地下载和安装FMDIDE IDE。安装程序会自动检测用户的操作系统,并根据操作系统的要求和兼容性进行相应的安装。 安装过程很简单,只需按照屏幕上的指示进行操作。用户只需选择安装目录和其他可选的组件,然后点击“安装”按钮。安装程序将自动将所需的文件复制到指定的目录,并配置必要的环境变量和系统设置。 安装完成后,用户可以立即开始使用FMDIDE进行编码和开发工作。FMDIDE提供了一个直观和用户友好的界面,可以轻松地创建、编辑和构建各种类型的应用程序。它还提供了各种工具和功能,如代码自动完成、错误检查和调试器,以帮助用户提高工作效率和编程质量。 总之,fmdide_setup是一个方便和易于使用的安装程序,用于安装和配置FMDIDE集成开发环境。通过安装FMDIDE,用户可以轻松地进行软件开发和编程工作,并享受到FMDIDE提供的各种功能和工具的帮助。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值