Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .github/workflows/dockerhub-main-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ jobs:
uses: docker/build-push-action@v6
with:
push: true
tags: oislen/randomtelecompayments:latest
build-args: GIT_BRANCH=main
tags: oislen/randomtelecompayments:latest
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,19 @@ FROM ubuntu:latest
# set environment variables
ENV user=ubuntu
ENV DEBIAN_FRONTEND=noninteractive
# set git branch for cloning
ARG GIT_BRANCH
ENV GIT_BRANCH=${GIT_BRANCH}
# set python version
ARG PYTHON_VERSION="3.12"
ENV PYTHON_VERSION=${PYTHON_VERSION}

# install required software and programmes for development environment
RUN apt-get update
RUN apt-get install -y apt-utils vim curl wget unzip git tree htop
RUN apt-get install -y apt-utils vim curl wget unzip tree htop

# set up home environment
RUN mkdir -p /home/${user} && chown -R ${user}: /home/${user}

# clone git repo
RUN git clone https://github.com/oislen/RandomTelecomPayments.git --branch ${GIT_BRANCH} /home/ubuntu/RandomTelecomPayments
#COPY . /home/ubuntu/RandomTelecomPayments
# copy repo
COPY . /home/ubuntu/RandomTelecomPayments

# add deadsnakes ppa
RUN apt-get install -y software-properties-common
Expand Down
Binary file added data/unittest/transaction_data.parquet
Binary file not shown.
Binary file removed data/unittest/transaction_data.pickle
Binary file not shown.
Binary file added data/unittest/user_data.parquet
Binary file not shown.
Binary file removed data/unittest/user_data.pickle
Binary file not shown.
3 changes: 1 addition & 2 deletions exeDocker.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ SET DOCKER_REPO=randomtelecompayments
SET DOCKER_TAG=latest
SET DOCKER_IMAGE=%DOCKER_USER%/%DOCKER_REPO%:%DOCKER_TAG%
SET DOCKER_CONTAINER_NAME=rtp
SET GIT_BRANCH=v0.1.0

:: remove existing docker containers and images
docker image rm -f %DOCKER_IMAGE%

:: build docker image
call docker build --no-cache -t %DOCKER_IMAGE% . --build-arg GIT_BRANCH=%GIT_BRANCH%
call docker build --no-cache -t %DOCKER_IMAGE% .

:: run docker container
SET UBUNTU_DIR=/home/ubuntu
Expand Down
1 change: 0 additions & 1 deletion exeGenNames.cmd

This file was deleted.

2 changes: 0 additions & 2 deletions exeMain.cmd

This file was deleted.

2 changes: 0 additions & 2 deletions exeMain.sh

This file was deleted.

3 changes: 0 additions & 3 deletions exeUnittests.sh

This file was deleted.

4 changes: 2 additions & 2 deletions generator/cons.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
fpath_llama_firstnames = os.path.join(subdir_data, 'ref', 'llama_firstnames.csv')
fpath_llama_lastnames = os.path.join(subdir_data, 'ref', 'llama_lastnames.csv')
fpath_smartphones = os.path.join(subdir_data, 'ref', 'smartphones.csv')
fpath_unittest_user_data = os.path.join(subdir_unittest, 'user_data.pickle')
fpath_unittest_transaction_data = os.path.join(subdir_unittest, 'transaction_data.pickle')
fpath_unittest_user_data = os.path.join(subdir_unittest, 'user_data.parquet')
fpath_unittest_transaction_data = os.path.join(subdir_unittest, 'transaction_data.parquet')
fpath_aws_session_token = os.path.join(subdir_creds,'sessionToken.json')

# set url links to files available online
Expand Down
1 change: 1 addition & 0 deletions generator/exeGenNames.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
call python -m pdb utilities\gen_user_names_file.py
2 changes: 2 additions & 0 deletions generator/exeMain.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
call python -m pdb main.py --n_users 100 --use_random_seed 1 --n_itr 1
:: call python -m pdb main.py --n_users 13000 --use_random_seed 1 --n_itr 2
2 changes: 2 additions & 0 deletions generator/exeMain.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python3 -m pdb main.py --n_users 100 --use_random_seed 1 --n_itr 1
# python3 -m pdb main.py --n_users 13000 --use_random_seed 1 --n_itr 2
4 changes: 3 additions & 1 deletion exeUnittests.cmd → generator/exeUnittests.cmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
call cd ..
call python -m unittest discover generator\unittests\utilities
call python -m unittest discover generator\unittests\objects
call python -m unittest discover generator\unittests\app
call python -m unittest discover generator\unittests\app
call cd generator
5 changes: 5 additions & 0 deletions generator/exeUnittests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
cd ..
python3 -m unittest discover unittests/utilities
python3 -m unittest discover unittests/objects
python3 -m unittest discover unittests/app
cd generator
8 changes: 4 additions & 4 deletions generator/unittests/app/test_gen_user_trans_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@
# if writing observed data to unittest data directory
if cons.unittest_gen_test_dfs:
print(f"WARNING: cons.unittest_gen_test_dfs == {cons.unittest_gen_test_dfs}")
obs_user_data.to_pickle(fpath_unittest_user_data)
obs_trans_data.to_pickle(fpath_unittest_transaction_data)
obs_user_data.to_parquet(fpath_unittest_user_data)
obs_trans_data.to_parquet(fpath_unittest_transaction_data)

# load in expected user level data
exp_user_data = pd.read_pickle(fpath_unittest_user_data)
exp_trans_data = pd.read_pickle(fpath_unittest_transaction_data)
exp_user_data = pd.read_parquet(fpath_unittest_user_data)
exp_trans_data = pd.read_parquet(fpath_unittest_transaction_data)

class Test_gen_user_trans_data(unittest.TestCase):
""""""
Expand Down