Skip to content

Commit

Permalink
update code
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanronaldo committed Oct 25, 2022
1 parent 2b957e3 commit f2f1c60
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.snap
*.tar.gz
__pycache__/
parts/
prime/
stage/
venv/
.vscode/
Empty file added app/__init__.py
Empty file.
18 changes: 18 additions & 0 deletions app/iotdb_installer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from os import listdir, system, getcwd

class IoTDBInstaller:
working_directory = getcwd()
resource_path = "/" + "/".join(working_directory.split('/')[2:])
iotdb_directory = "apache-iotdb-0.13.0-all-bin"

def install(self):
system("cp -r %s ./" % (self.resource_path + '/' + self.iotdb_directory))
system("chmod -R +xw ./apache-iotdb-0.13.0-all-bin")

def has_installed(self):
if self.iotdb_directory in listdir('./'):
return True
return False

def start_iotdb(self):
system("./apache-iotdb-0.13.0-all-bin/sbin/start-server.sh")
3 changes: 3 additions & 0 deletions build-snap-amd64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
snapcraft clean --destructive-mode
snapcraft --destructive-mode --target-arch=amd64 --enable-experimental-target-arch
3 changes: 3 additions & 0 deletions build-snap-arm64.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
snapcraft clean --destructive-mode
snapcraft --destructive-mode --target-arch=arm64 --enable-experimental-target-arch
4 changes: 4 additions & 0 deletions install-venv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
virtualenv -p python3 venv
source venv/bin/activate
pip3 install -r requirements.txt
7 changes: 7 additions & 0 deletions install_iotdb.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python3
from app.iotdb_installer import IoTDBInstaller

installer = IoTDBInstaller()
if installer.has_installed() is False:
installer.install()
installer.start_iotdb()
Empty file added requirements.txt
Empty file.
11 changes: 11 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from setuptools import setup

setup(name='iotdb',
version='0.13.0',
description='Apache IoTDB v0.13.0',
author='Xuan Ronaldo',
packages=['app'],
install_requires=[],
scripts=['install_iotdb.py'],
license='Copyright (c) 2021 Bosch Rexroth AG, Licensed under MIT License'
)
24 changes: 24 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: apache-iotdb # you probably want to 'snapcraft register <name>'
base: core20 # the base snap is the execution environment for this snap
version: 0.13.0 # just for humans, typically '1.2+git' or '1.3.2'
summary: Apache IoTDB v0.13.0 # 79 char long summary
description: |
Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for data management and analysis, deployable on the edge and the cloud. Due to its light-weight architecture, high performance and rich feature set together with its deep integration with Apache Hadoop, Spark and Flink, Apache IoTDB can meet the requirements of massive data storage, high-speed data ingestion and complex data analysis in the IoT industrial fields.
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots

apps:
install-iotdb:
command: bin/install_iotdb.py
plugs:
- network-bind
daemon: simple

parts:
iotdb:
plugin: python
source: .
env:
plugin: dump
source: ./env-amd.tar.gz

0 comments on commit f2f1c60

Please sign in to comment.