Skip to content

Commit

Permalink
added docker image, changed readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil.Karol committed Jan 14, 2025
1 parent 118d73f commit d11548e
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 39 deletions.
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Stage 1: Cache Gradle dependencies
FROM gradle:latest AS cache
RUN mkdir -p /home/gradle/cache_home
ENV GRADLE_USER_HOME /home/gradle/cache_home
COPY build.gradle.* gradle.properties /home/gradle/app/
COPY gradle /home/gradle/app/gradle
WORKDIR /home/gradle/app
RUN gradle clean build -i --stacktrace

# Stage 2: Build Application
FROM gradle:latest AS build
COPY --from=cache /home/gradle/cache_home /home/gradle/.gradle
COPY . /usr/src/app/
WORKDIR /usr/src/app
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle ij-server:buildFatJar --no-daemon

# Stage 3: Create the Runtime Image
FROM amazoncorretto:11 AS runtime
EXPOSE 8080
RUN mkdir /app
COPY --from=build /home/gradle/src/ij-server/build/libs/ij-server-all.jar /app/ktor-docker-sample.jar
ENTRYPOINT ["java","-jar","/app/ktor-docker-sample.jar"]
49 changes: 12 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,23 @@
[![Gradle Build](https://github.com/JetBrains-Research/tasktracker-3/actions/workflows/build.yml/badge.svg)](https://github.com/JetBrains-Research/tasktracker-3/actions/workflows/build.yml)

# TaskTracker 3.0
# KOALA (Knowledge Observation and Learning Analytics)

The main goal of this project is to create a plugin for intellij-based IDEs
to be able to collect more rare and usually not accessible data like change logs,
code quality and other. This will allow us to conduct better studies, produce more precise
ux-studies and potentially speed up user-testing for experimental features.
**Koala** is a powerful tool designed to run controlled experiments and collect data directly within JetBrains IDEs. Its primary advantage lies in its full customization: with flexible configuration files, **Koala** can be adapted to suit any experimental scenario.

The tool's functionality extends beyond basic data collection. By gathering detailed and often hard-to-access information—such as change logs, code quality metrics, and user interaction patterns — **Koala** empowers researchers to conduct deeper, more precise UX studies and behavioral analyses.

This level of insight opens up opportunities to:

The plugin is capable of collecting the following data:
- Snapshots of all code changes.
- All activities that occurred in the IDE. More details about activity types you can find [here](ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/tracking/activity/ActivityEvent.kt).
- Switching between file windows.
- Switching between tool and IDE plugin windows.
- Survey responses.
- Third-party logs/files specified in the [configuration](ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/content/PluginInfoConfig.kt) by this [structure](ij-plugin/src/main/kotlin/org/jetbrains/research/tasktracker/config/content/Log.kt).
- Improve experimental studies by providing richer, more actionable data.
- Streamline user testing for experimental features.
- Facilitate faster iteration and decision-making in UX and product development.
- **Koala** is built with adaptability in mind, making it an essential resource for teams looking to conduct studies or improve development workflows in JetBrains IDEs.

Here we want to notice that the plugin and the server would not collect any of the user data outside given tasks.

The plugin works in conjunction with the [server](ij-server), which is located in the same repository. The server receives, processes, and saves the data that was sent from the plugin side.
The [plugin](ij-plugin) works in conjunction with the [server](ij-server), which is located in the same repository. The server receives, processes, and saves the data that was sent from the plugin side.

The settings of the plugin configuration and interaction with its server are stored [here](ij-plugin/src/main/resources/properties/actual). If this directory does not exist, it will be created with default properties and values.

Here we want to notice that the plugin will not collect any of the user data outside given tasks.

The previous versions of the plugin:
The previous versions of the tool:

- The first version - [repository](https://github.com/JetBrains-Research/task-tracker-plugin)
- The second version - TODO: add a link

## Getting started

### Developer mode

Just clone the repository and build the project:

```text
./gradlew build
```

Next, to run the plugin, run the `runIde` intellij task:

```text
./gradlew runIde
```

You can use the run IDE plugin configuration: [configuration file](./.run/Run%20IDE%20with%20Plugin.run.xml).
- The second version - [repository](https://github.com/samorojy/task-tracker-plugin/tree/revival)
11 changes: 11 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
server:
image: daniilkarol/koala:latest
ports:
- "8080:8080"
environment:
- HOST=
- PORT=
- DB_URL=
- DB_USERNAME=
- DB_PASSWORD=
32 changes: 32 additions & 0 deletions ij-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Plugin

The plugin is capable of collecting the following data:
- Snapshots of all code changes.
- All activities that occurred in the IDE. More details about activity types you can find [here](src/main/kotlin/org/jetbrains/research/tasktracker/tracking/activity/ActivityEvent.kt).
- Switching between file windows.
- Switching between tool and IDE plugin windows.
- Survey responses.
- Third-party logs/files specified in the [configuration](src/main/kotlin/org/jetbrains/research/tasktracker/config/content/PluginInfoConfig.kt) by this [structure](src/main/kotlin/org/jetbrains/research/tasktracker/config/content/Log.kt).


The settings of the plugin configuration and interaction with its server are stored [here](src/main/resources/properties/actual). If this directory does not exist, it will be created with default properties and values.


## Getting started


### Developer mode

Just clone the repository and build the project:

```text
./gradlew build
```

Next, to run the plugin, run the `runIde` intellij task:

```text
./gradlew runIde
```

You can use the run IDE plugin configuration: [configuration file](../.run/Run%20IDE%20with%20Plugin.run.xml).
19 changes: 19 additions & 0 deletions ij-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Server

The server is written on the Ktor framework and uses a PostgreSQL database for data storage and processing. The server
also saves the data received from the plugin as directories in the specified path (customization of the path for saving
will be available later).

For a more convenient server setup for your needs, we provide the option to create a Docker container. To do this, you
can use the image named `daniilkarol/koala:latest`. You can also find a [docker compose](../docker-compose.yml) file that already provides a template to start a docker
container.

The server requires a certain number of environment variables, as follows:
- `HOST` - host address ([0.0.0.0]() by default)
- `PORT` - app port ([8080]() by default)
- `DB_URL` - postgres database url in format `postgresql://[user[:password]@][netloc][:port][/dbname]`
- `DB_USERNAME` - username for the database
- `DB_PASSWORD` - password for the database



10 changes: 9 additions & 1 deletion ij-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ plugins {
}

val jdkVersion = libs.versions.jdk11.get()
val mainClassPath = "org.jetbrains.research.tasktracker.ApplicationKt"


application {
mainClass.set("org.jetbrains.research.tasktracker.ApplicationKt")
mainClass.set(mainClassPath)

val isDevelopment: Boolean = project.ext.has("development")
applicationDefaultJvmArgs = listOf("-Dio.ktor.development=$isDevelopment")
Expand Down Expand Up @@ -43,4 +45,10 @@ tasks{
withType<Detekt>().configureEach {
jvmTarget = jdkVersion
}

withType<Jar> {
manifest {
attributes["Main-Class"] = mainClassPath
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ import org.jetbrains.research.tasktracker.database.DatabaseFactory
import org.jetbrains.research.tasktracker.plugins.configureRouting

fun main() {
embeddedServer(Netty, port = 8080, host = "0.0.0.0", module = Application::module)
embeddedServer(
Netty,
port = System.getenv("PORT").toIntOrNull() ?: 8080,
host = System.getenv("HOST") ?: "0.0.0.0",
module = Application::module
)
.start(wait = true)
}

Expand Down

0 comments on commit d11548e

Please sign in to comment.